Ver código fonte

Add documentation for essentials

tags/v2.1.3^2
9seconds 4 anos atrás
pai
commit
ef55fbba15
2 arquivos alterados com 18 adições e 1 exclusões
  1. 12
    1
      essentials/conns.go
  2. 6
    0
      essentials/doc.go

+ 12
- 1
essentials/conns.go Ver arquivo

@@ -1,15 +1,26 @@
1 1
 package essentials
2 2
 
3
-import "net"
3
+import (
4
+	"io"
5
+	"net"
6
+)
4 7
 
8
+// CloseableReader is a reader interface that can close its reading end.
5 9
 type CloseableReader interface {
10
+	io.Reader
11
+
6 12
 	CloseRead() error
7 13
 }
8 14
 
15
+// CloseableWriter is a writer that can close its writing end.
9 16
 type CloseableWriter interface {
17
+	io.Writer
18
+
10 19
 	CloseWrite() error
11 20
 }
12 21
 
22
+// Conn is an extension of net.Conn that can close its ends. This mostly
23
+// implies TCP connections.
13 24
 type Conn interface {
14 25
 	net.Conn
15 26
 	CloseableReader

+ 6
- 0
essentials/doc.go Ver arquivo

@@ -0,0 +1,6 @@
1
+// This is a minimal package that contains _essentials_ of mtglib and its
2
+// complimentary packages. This is mostly required to comply some interfaces
3
+// between mtglib and its internals to avoid circular dependencies.
4
+//
5
+// This package should contain only bare minimum and mostly technical.
6
+package essentials

Carregando…
Cancelar
Salvar