Documentation ¶
Index ¶
- Constants
- type ByteCache
- type ConditionFunc
- type ReadPipeline
- func (this *ReadPipeline) ByteBreakRead(condition ...byte) (res []byte, err error)
- func (this *ReadPipeline) Capture() error
- func (this *ReadPipeline) ConditionRead(condition ConditionFunc) (res []byte, err error)
- func (this *ReadPipeline) Read(buff []byte) (size int, err error)
- func (this *ReadPipeline) RemainingSize() int64
- type ReadPipelineItf
Constants ¶
View Source
const ( ErrRepeatExecution = "RepeatExecution" ErrRequestSizeLargerThanCache = "ErrRequestSizeLargerThanCache" ErrTimeOut = "ErrTimeOut" )
View Source
const ErrByteCacheClosed = "ErrByteCacheClosed"
ErrByteCacheClosed try call a closed ByteCache.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteCache ¶
type ByteCache struct {
// contains filtered or unexported fields
}
ByteCache .
func NewByteCache ¶
NewByteCache .
func (*ByteCache) SetTimeOut ¶
SetTimeOut how much time can wait.
type ConditionFunc ¶
type ReadPipeline ¶
type ReadPipeline struct { BuffSize int //the size when read from reader. CacheSize int //the size save in chan. ErrChan chan error TimeOut time.Duration // contains filtered or unexported fields }
func NewFileReadPipeline ¶
func NewFileReadPipeline(fname string) (*ReadPipeline, error)
func NewReadPipeline ¶
func NewReadPipeline(reader io.Reader, closer io.Closer) *ReadPipeline
func (*ReadPipeline) ByteBreakRead ¶
func (this *ReadPipeline) ByteBreakRead(condition ...byte) (res []byte, err error)
func (*ReadPipeline) Capture ¶
func (this *ReadPipeline) Capture() error
func (*ReadPipeline) ConditionRead ¶
func (this *ReadPipeline) ConditionRead(condition ConditionFunc) (res []byte, err error)
func (*ReadPipeline) RemainingSize ¶
func (this *ReadPipeline) RemainingSize() int64
Click to show internal directories.
Click to hide internal directories.