Просмотр исходного кода

Add documentation for essentials

tags/v2.1.3^2
9seconds 4 лет назад
Родитель
Сommit
ef55fbba15
2 измененных файлов: 18 добавлений и 1 удалений
  1. 12
    1
      essentials/conns.go
  2. 6
    0
      essentials/doc.go

+ 12
- 1
essentials/conns.go Просмотреть файл

1
 package essentials
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
 type CloseableReader interface {
9
 type CloseableReader interface {
10
+	io.Reader
11
+
6
 	CloseRead() error
12
 	CloseRead() error
7
 }
13
 }
8
 
14
 
15
+// CloseableWriter is a writer that can close its writing end.
9
 type CloseableWriter interface {
16
 type CloseableWriter interface {
17
+	io.Writer
18
+
10
 	CloseWrite() error
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
 type Conn interface {
24
 type Conn interface {
14
 	net.Conn
25
 	net.Conn
15
 	CloseableReader
26
 	CloseableReader

+ 6
- 0
essentials/doc.go Просмотреть файл

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

Загрузка…
Отмена
Сохранить