Add documentation for essentials

This commit is contained in:
9seconds
2021-12-01 14:56:39 +03:00
parent e7416bc04d
commit ef55fbba15
2 changed files with 18 additions and 1 deletions
+12 -1
View File
@@ -1,15 +1,26 @@
package essentials package essentials
import "net" import (
"io"
"net"
)
// CloseableReader is a reader interface that can close its reading end.
type CloseableReader interface { type CloseableReader interface {
io.Reader
CloseRead() error CloseRead() error
} }
// CloseableWriter is a writer that can close its writing end.
type CloseableWriter interface { type CloseableWriter interface {
io.Writer
CloseWrite() error CloseWrite() error
} }
// Conn is an extension of net.Conn that can close its ends. This mostly
// implies TCP connections.
type Conn interface { type Conn interface {
net.Conn net.Conn
CloseableReader CloseableReader
+6
View File
@@ -0,0 +1,6 @@
// This is a minimal package that contains _essentials_ of mtglib and its
// complimentary packages. This is mostly required to comply some interfaces
// between mtglib and its internals to avoid circular dependencies.
//
// This package should contain only bare minimum and mostly technical.
package essentials