Documentation ¶
Index ¶
- Constants
- func PackBool(b bool) []byte
- func PackInt(num int) []byte
- func PackStr(str string) []byte
- func UnpackInt(data []byte) int
- func UnpackMsgAndSys(data []byte) (msgId int, system bool)
- type Unpacker
- func (u *Unpacker) Data() []byte
- func (u *Unpacker) GetByte() (byte, error)
- func (u *Unpacker) GetInt() int
- func (u *Unpacker) GetMsgAndSys() (msgId int, system bool, err error)
- func (u *Unpacker) GetRaw(size int) ([]byte, error)
- func (u *Unpacker) GetString() (string, error)
- func (u *Unpacker) GetStringSanitized(sanitizeType int) (string, error)
- func (u *Unpacker) RemainingData() []byte
- func (u *Unpacker) RemainingSize() int
- func (u *Unpacker) Reset(data []byte)
- func (u *Unpacker) Rest() []byte
- func (u *Unpacker) Size() int
Constants ¶
View Source
const ( Sanitize = 1 SanitizeCC = 2 SanitizeSkipWhitespaces = 4 )
Variables ¶
This section is empty.
Functions ¶
func UnpackMsgAndSys ¶
Types ¶
type Unpacker ¶
type Unpacker struct {
// contains filtered or unexported fields
}
func (*Unpacker) Data ¶
get the full payload from the very beginning
see also: - Rest() - RemainingData()
func (*Unpacker) GetMsgAndSys ¶
func (*Unpacker) GetStringSanitized ¶
func (*Unpacker) RemainingData ¶
read only operation does not consume the data if you need to consume the data use Rest() instead this method is mostly used for debugging
see also: - Rest() - Data()
func (*Unpacker) RemainingSize ¶
Click to show internal directories.
Click to hide internal directories.