parserio

package
v0.0.0-...-750c461 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: BSD-3-Clause-Clear Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ModInfo = "ParserIO"

Variables

View Source
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 NewReadParserIO(conn io.Reader) *ParserIO

func NewReadParserIOEx

func NewReadParserIOEx(conn io.Reader, bufSize int) *ParserIO

func NewReadWriteParserIOEx

func NewReadWriteParserIOEx(conn io.Reader, wconn io.Writer, bufSize int) *ParserIO

func (*ParserIO) Discard

func (p *ParserIO) Discard(len int) (int, error)

Discard discard len bytes data returns number of discarded data in bytes

func (*ParserIO) DiscardEx

func (p *ParserIO) DiscardEx(isDisposable func(c byte) bool) int

func (*ParserIO) Flush

func (p *ParserIO) Flush() error

Flush dummy flush implement

func (*ParserIO) Lock

func (p *ParserIO) Lock()

Lock lock read/write

func (*ParserIO) Mark

func (p *ParserIO) Mark() int

func (*ParserIO) MarkReadLimit

func (p *ParserIO) MarkReadLimit(maxReadLimit int)

MarkReadLimit limit maximum available bytes for read

func (*ParserIO) Prepare

func (p *ParserIO) Prepare(size int) (int, error)

Prepare at most {size} bytes data to be read returns actually available bytes

func (*ParserIO) PrepareEx

func (p *ParserIO) PrepareEx(size int) (int, error)

PrepareEx Prepare at lest {size} bytes data to be read returns actually available bytes

func (*ParserIO) Read

func (p *ParserIO) Read(b []byte) (n int, err error)

func (*ParserIO) ReadByte

func (p *ParserIO) ReadByte() (b byte, err error)

ReadByte read one byte

func (*ParserIO) ReadBytes

func (p *ParserIO) ReadBytes(isEnd func(c byte) bool) ([]byte, error)

ReadBytes reads string till reach END which determined by isEnd function, returns bytes including 'end' byte

func (*ParserIO) ReadInt16

func (p *ParserIO) ReadInt16() (val int16, err error)

ReadInt16 read 16-bit signed integer in little-endian

func (*ParserIO) ReadInt16BE

func (p *ParserIO) ReadInt16BE() (val int16, err error)

ReadInt16BE read 16-bit signed integer in big-endian

func (*ParserIO) ReadInt32

func (p *ParserIO) ReadInt32() (val int32, err error)

ReadInt32 read 32-bit signed integer in little-endian

func (*ParserIO) ReadInt32BE

func (p *ParserIO) ReadInt32BE() (val int32, err error)

ReadInt32BE read 32-bit signed integer in big-endian

func (*ParserIO) ReadLen

func (p *ParserIO) ReadLen(b []byte, bLen int) (int, error)

ReadLen read bLen bytes data into b returns number of bytes that has been read

func (*ParserIO) ReadLimit

func (p *ParserIO) ReadLimit() int

ReadLimit return maximum available bytes to read

func (*ParserIO) ReadLine

func (p *ParserIO) ReadLine() ([]byte, error)

func (*ParserIO) ReadString

func (p *ParserIO) ReadString(end byte) (string, error)

ReadString reads string till reach 'end' character, returns string including 'end' character

func (*ParserIO) ReadStringEx

func (p *ParserIO) ReadStringEx(isEnd func(c byte) bool) (string, error)

func (*ParserIO) ReadStringLen

func (p *ParserIO) ReadStringLen(bLen int) (string, error)

ReadStringLen reads bLen bytes len string.

func (*ParserIO) ReadStringLine

func (p *ParserIO) ReadStringLine() (string, error)

func (*ParserIO) ReadUInt16

func (p *ParserIO) ReadUInt16() (val uint16, err error)

ReadUInt16 read 16-bit unsigned integer in little-endian

func (*ParserIO) ReadUInt16BE

func (p *ParserIO) ReadUInt16BE() (val uint16, err error)

ReadUInt16BE read 32-bit unsigned integer in big-endian

func (*ParserIO) ReadUInt32

func (p *ParserIO) ReadUInt32() (val uint32, err error)

ReadUInt32 read in little-endian

func (*ParserIO) ReadUInt32BE

func (p *ParserIO) ReadUInt32BE() (val uint32, err error)

ReadUInt32BE read 32-bit unsigned integer in big-endian

func (*ParserIO) ReadUInt64BE

func (p *ParserIO) ReadUInt64BE() (val uint64, err error)

ReadUInt64BE read 64-bit unsigned integer in big-endian

func (*ParserIO) ResetToMark

func (p *ParserIO) ResetToMark() int

func (*ParserIO) Unlock

func (p *ParserIO) Unlock()

Unlock unlock read/write

func (*ParserIO) UnreadByte

func (p *ParserIO) UnreadByte() error

UnreadByte unread last one byte

func (*ParserIO) UnreadBytes

func (p *ParserIO) UnreadBytes(nbytes int) error

UnreadBytes unread bytes

func (*ParserIO) Write

func (p *ParserIO) Write(b []byte) (int, error)

Write write byte array buffer return the number of bytes actually written

func (*ParserIO) WriteInt16

func (p *ParserIO) WriteInt16(val int16) (int, error)

WriteInt16 write 16-bit signed integer in little-endian

func (*ParserIO) WriteInt16BE

func (p *ParserIO) WriteInt16BE(val int16) (int, error)

WriteInt16BE write 16-bit signed integer in big-endian

func (*ParserIO) WriteInt32

func (p *ParserIO) WriteInt32(val int32) (int, error)

WriteInt32 write 32-bit signed integer in little-endian

func (*ParserIO) WriteInt32BE

func (p *ParserIO) WriteInt32BE(val int32) (int, error)

WriteInt32BE write 32-bit signed integer in big-endian

func (*ParserIO) WriteInt64BE

func (p *ParserIO) WriteInt64BE(val int64) (int, error)

WriteInt64BE write 64-bit signed integer in big-endian

func (*ParserIO) WriteString

func (p *ParserIO) WriteString(s string) (int, error)

WriteString write string return the number of bytes actually written

func (*ParserIO) WriteUInt16

func (p *ParserIO) WriteUInt16(val uint16) (int, error)

WriteUInt16 write 16-bit unsigned integerin little-endian

func (*ParserIO) WriteUInt16BE

func (p *ParserIO) WriteUInt16BE(val uint16) (int, error)

WriteUInt16BE write 16-bit unsigned integer in big-endian

func (*ParserIO) WriteUInt32

func (p *ParserIO) WriteUInt32(val uint32) (int, error)

WriteUInt32 write 32-bit unsigned integer in little-endian

func (*ParserIO) WriteUInt32BE

func (p *ParserIO) WriteUInt32BE(val uint32) (int, error)

WriteUInt32BE write 32-bit unsigned integer in big-endian

Jump to

Keyboard shortcuts

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