Documentation ¶
Overview ¶
Package containing the types and errors used by all other packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeserializeFailedError ¶
type DeserializeFailedError string
Deserialization of an object failed. Used by Deserialize and DeserializeReader methods of the NetworkSerializer interface.
func (DeserializeFailedError) Error ¶
func (e DeserializeFailedError) Error() string
type NotEnoughBytesError ¶
type NotEnoughBytesError int
Read failed because of not enough bytes.
func (NotEnoughBytesError) Error ¶
func (e NotEnoughBytesError) Error() string
type Varint ¶
type Varint uint64
Integer can be encoded depending on the represented value to save space. Variable length integers always precede an array/vector of a type of data that may vary in length. Varints MUST use the minimum possible number of bytes to encode a value.
For example: the value 6 can be encoded with one byte therefore a varint that uses three bytes to encode the value 6 is malformed and the decoding task must be aborted.
type VarintList ¶
type VarintList []Varint
n integers can be stored using n+1 variable length integers where the first var_int equals n.
func (*VarintList) DeserializeReader ¶
func (i *VarintList) DeserializeReader(b io.Reader) error
func (VarintList) Serialize ¶
func (i VarintList) Serialize() []byte
type VarintMinimumSizeError ¶
type VarintMinimumSizeError struct{}
Number encoded as varint does not use minimum bytes for representation.
func (VarintMinimumSizeError) Error ¶
func (e VarintMinimumSizeError) Error() string