FILE / ScuroNeko/mtg

essentials/conns.go

Исходный файл и его история в репозитории.
FILE ae88c0cab03d04353892aa22ba1c811699d1464f
Files
mtg/essentials/conns.go
T
2022-08-04 18:39:00 +03:00

27 lines
497 B
Go

package essentials
import (
"io"
"net"
)
// CloseableReader is an [io.Reader] interface that can close its reading end.
type CloseableReader interface {
io.Reader
CloseRead() error
}
// CloseableWriter is an [io.Writer] that can close its writing end.
type CloseableWriter interface {
io.Writer
CloseWrite() error
}
// Conn is an extension of [net.Conn] that can close its ends. This mostly
// implies TCP connections.
type Conn interface {
net.Conn
CloseableReader
CloseableWriter
}