channel

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2020 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

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) Read

func (channel *BufferedChannel) Read() *[]byte

read by buffer

func (*BufferedChannel) ReadEnd

func (channel *BufferedChannel) ReadEnd() *[]byte

read by end

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL