-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.go
52 lines (43 loc) · 1009 Bytes
/
data.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package data
import (
"bytes"
"io"
"os"
)
// WriteCloser is an interface
type WriteCloser interface {
Write(p []byte) (int, error)
Close() error
}
// ReadCloser is an interface
type ReadCloser interface {
Read(p []byte) (int, error)
Close() error
}
// ReadAtSeekerWriteToCloser is an interface
type ReadAtSeekerWriteToCloser interface {
io.Seeker
io.Closer
io.Reader
io.ReaderAt
io.WriterTo
// Size is an size of content
Size() int64
// Done Completion of work with data
Done()
}
// writeCloserImplementation is an implementation
type writeCloserImplementation struct {
essence io.Writer
closer func() error
}
// readCloserImplementation is an implementation
type readCloserImplementation struct {
essence io.Reader
closer func() error
}
// readAtSeekerWriteToCloserImplementation is an implementation
type readAtSeekerWriteToCloserImplementation struct {
contentData *bytes.Reader // Контент в памяти
contentFh *os.File // Контент в файле
}