Documentation
¶
Index ¶
- type BufferedChannel
- func (channel *BufferedChannel) Close()
- func (channel *BufferedChannel) Count() int64
- func (channel *BufferedChannel) File() *os.File
- func (channel *BufferedChannel) IsOpen() bool
- func (channel *BufferedChannel) Length() int
- func (channel *BufferedChannel) MaxOffset() int64
- func (channel *BufferedChannel) Offset() int64
- func (channel *BufferedChannel) Read() *[]byte
- func (channel *BufferedChannel) ReadEnd() *[]byte
- func (channel *BufferedChannel) ReadLine() *[]byte
- func (channel *BufferedChannel) ReadRune(end rune, includeRune bool) *[]byte
- func (channel *BufferedChannel) SetOffset(offset int64)
- func (channel *BufferedChannel) TotalLength() int64
- type Channel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferedChannel ¶
type BufferedChannel struct {
// contains filtered or unexported fields
}
Define buffered channel struct
func NewBufferedChannel ¶
func NewBufferedChannel(file string, bufferSize int) *BufferedChannel
func (*BufferedChannel) Close ¶
func (channel *BufferedChannel) Close()
func (*BufferedChannel) Count ¶
func (channel *BufferedChannel) Count() int64
func (*BufferedChannel) File ¶
func (channel *BufferedChannel) File() *os.File
func (*BufferedChannel) IsOpen ¶
func (channel *BufferedChannel) IsOpen() bool
func (*BufferedChannel) Length ¶
func (channel *BufferedChannel) Length() int
func (*BufferedChannel) MaxOffset ¶
func (channel *BufferedChannel) MaxOffset() int64
func (*BufferedChannel) Offset ¶
func (channel *BufferedChannel) Offset() int64
func (*BufferedChannel) ReadLine ¶
func (channel *BufferedChannel) ReadLine() *[]byte
func (*BufferedChannel) ReadRune ¶
func (channel *BufferedChannel) ReadRune(end rune, includeRune bool) *[]byte
read by rune
func (*BufferedChannel) SetOffset ¶
func (channel *BufferedChannel) SetOffset(offset int64)
func (*BufferedChannel) TotalLength ¶
func (channel *BufferedChannel) TotalLength() int64
type Channel ¶
type Channel interface { //Check channel is opened IsOpen() bool //Close channel Close() //Get the last read data length of the channel Length() int //Get the total length of channel reads TotalLength() int64 //Get the number of channel reads Count() int64 //Get the offset of the file in the channel (file pointer offset) Offset() int64 //Set the offset of the file in the channel (file pointer offset) SetOffset(offset int64) //Get the maximum offset of the file in the channel (file length: byte) MaxOffset() int64 //Read the data in the channel Read() *[]byte //Read the end character data in the channel ReadRune(end rune, includeRune bool) *[]byte //Read data in channel by line ReadLine() *[]byte //Get all data of files in the channel ReadEnd() *[]byte }
Define channel interface
Click to show internal directories.
Click to hide internal directories.