|
|
@@ -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
|