Documentation ¶
Index ¶
- Constants
- Variables
- type IOMultiPlexer
- type ParserIO
- func NewParserIO(conn io.ReadWriter) *ParserIO
- func NewParserIOEx(conn io.ReadWriter, bufSize int) *ParserIO
- func NewReadParserIO(conn io.Reader) *ParserIO
- func NewReadParserIOEx(conn io.Reader, bufSize int) *ParserIO
- func NewReadWriteParserIOEx(conn io.Reader, wconn io.Writer, bufSize int) *ParserIO
- func (p *ParserIO) Discard(len int) (int, error)
- func (p *ParserIO) DiscardEx(isDisposable func(c byte) bool) int
- func (p *ParserIO) Flush() error
- func (p *ParserIO) Lock()
- func (p *ParserIO) Mark() int
- func (p *ParserIO) MarkReadLimit(maxReadLimit int)
- func (p *ParserIO) Prepare(size int) (int, error)
- func (p *ParserIO) PrepareEx(size int) (int, error)
- func (p *ParserIO) Read(b []byte) (n int, err error)
- func (p *ParserIO) ReadByte() (b byte, err error)
- func (p *ParserIO) ReadBytes(isEnd func(c byte) bool) ([]byte, error)
- func (p *ParserIO) ReadInt16() (val int16, err error)
- func (p *ParserIO) ReadInt16BE() (val int16, err error)
- func (p *ParserIO) ReadInt32() (val int32, err error)
- func (p *ParserIO) ReadInt32BE() (val int32, err error)
- func (p *ParserIO) ReadLen(b []byte, bLen int) (int, error)
- func (p *ParserIO) ReadLimit() int
- func (p *ParserIO) ReadLine() ([]byte, error)
- func (p *ParserIO) ReadString(end byte) (string, error)
- func (p *ParserIO) ReadStringEx(isEnd func(c byte) bool) (string, error)
- func (p *ParserIO) ReadStringLen(bLen int) (string, error)
- func (p *ParserIO) ReadStringLine() (string, error)
- func (p *ParserIO) ReadUInt16() (val uint16, err error)
- func (p *ParserIO) ReadUInt16BE() (val uint16, err error)
- func (p *ParserIO) ReadUInt32() (val uint32, err error)
- func (p *ParserIO) ReadUInt32BE() (val uint32, err error)
- func (p *ParserIO) ReadUInt64BE() (val uint64, err error)
- func (p *ParserIO) ResetToMark() int
- func (p *ParserIO) Unlock()
- func (p *ParserIO) UnreadByte() error
- func (p *ParserIO) UnreadBytes(nbytes int) error
- func (p *ParserIO) Write(b []byte) (int, error)
- func (p *ParserIO) WriteInt16(val int16) (int, error)
- func (p *ParserIO) WriteInt16BE(val int16) (int, error)
- func (p *ParserIO) WriteInt32(val int32) (int, error)
- func (p *ParserIO) WriteInt32BE(val int32) (int, error)
- func (p *ParserIO) WriteInt64BE(val int64) (int, error)
- func (p *ParserIO) WriteString(s string) (int, error)
- func (p *ParserIO) WriteUInt16(val uint16) (int, error)
- func (p *ParserIO) WriteUInt16BE(val uint16) (int, error)
- func (p *ParserIO) WriteUInt32(val uint32) (int, error)
- func (p *ParserIO) WriteUInt32BE(val uint32) (int, error)
Constants ¶
const ModInfo = "ParserIO"
Variables ¶
var ( ErrNotEnoughData = misc.MakeError("Not Enough Data!!") ErrBufferOverflow = misc.MakeError("Buffer Overflow!!") ErrNotComplete = misc.MakeError("Not complete") ErrReadOnly = misc.MakeError("ReadOnly!") )
Protocol IO errors
Functions ¶
This section is empty.
Types ¶
type IOMultiPlexer ¶
type IOMultiPlexer struct {
// contains filtered or unexported fields
}
func NewIOMultiPlexer ¶
func NewIOMultiPlexer() *IOMultiPlexer
func (*IOMultiPlexer) AddSinker ¶
func (p *IOMultiPlexer) AddSinker(os io.Writer)
func (*IOMultiPlexer) AddSource ¶
func (p *IOMultiPlexer) AddSource(is io.Reader)
func (*IOMultiPlexer) ReadLine ¶
func (p *IOMultiPlexer) ReadLine() (string, error)
func (*IOMultiPlexer) Write ¶
func (p *IOMultiPlexer) Write(str string)
type ParserIO ¶
type ParserIO struct {
// contains filtered or unexported fields
}
ParserIO -
func NewParserIO ¶
func NewParserIO(conn io.ReadWriter) *ParserIO
NewParserIO create ParserIO object from ReadWriter interface
func NewParserIOEx ¶
func NewParserIOEx(conn io.ReadWriter, bufSize int) *ParserIO
func NewReadParserIO ¶
func NewReadWriteParserIOEx ¶
func (*ParserIO) MarkReadLimit ¶
MarkReadLimit limit maximum available bytes for read
func (*ParserIO) Prepare ¶
Prepare at most {size} bytes data to be read returns actually available bytes
func (*ParserIO) PrepareEx ¶
PrepareEx Prepare at lest {size} bytes data to be read returns actually available bytes
func (*ParserIO) ReadBytes ¶
ReadBytes reads string till reach END which determined by isEnd function, returns bytes including 'end' byte
func (*ParserIO) ReadInt16BE ¶
ReadInt16BE read 16-bit signed integer in big-endian
func (*ParserIO) ReadInt32BE ¶
ReadInt32BE read 32-bit signed integer in big-endian
func (*ParserIO) ReadLen ¶
ReadLen read bLen bytes data into b returns number of bytes that has been read
func (*ParserIO) ReadString ¶
ReadString reads string till reach 'end' character, returns string including 'end' character
func (*ParserIO) ReadStringEx ¶
func (*ParserIO) ReadStringLen ¶
ReadStringLen reads bLen bytes len string.
func (*ParserIO) ReadStringLine ¶
func (*ParserIO) ReadUInt16 ¶
ReadUInt16 read 16-bit unsigned integer in little-endian
func (*ParserIO) ReadUInt16BE ¶
ReadUInt16BE read 32-bit unsigned integer in big-endian
func (*ParserIO) ReadUInt32 ¶
ReadUInt32 read in little-endian
func (*ParserIO) ReadUInt32BE ¶
ReadUInt32BE read 32-bit unsigned integer in big-endian
func (*ParserIO) ReadUInt64BE ¶
ReadUInt64BE read 64-bit unsigned integer in big-endian
func (*ParserIO) ResetToMark ¶
func (*ParserIO) UnreadBytes ¶
UnreadBytes unread bytes
func (*ParserIO) WriteInt16 ¶
WriteInt16 write 16-bit signed integer in little-endian
func (*ParserIO) WriteInt16BE ¶
WriteInt16BE write 16-bit signed integer in big-endian
func (*ParserIO) WriteInt32 ¶
WriteInt32 write 32-bit signed integer in little-endian
func (*ParserIO) WriteInt32BE ¶
WriteInt32BE write 32-bit signed integer in big-endian
func (*ParserIO) WriteInt64BE ¶
WriteInt64BE write 64-bit signed integer in big-endian
func (*ParserIO) WriteString ¶
WriteString write string return the number of bytes actually written
func (*ParserIO) WriteUInt16 ¶
WriteUInt16 write 16-bit unsigned integerin little-endian
func (*ParserIO) WriteUInt16BE ¶
WriteUInt16BE write 16-bit unsigned integer in big-endian
func (*ParserIO) WriteUInt32 ¶
WriteUInt32 write 32-bit unsigned integer in little-endian