types

package
v0.0.0-...-10088a8 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2015 License: MIT Imports: 5 Imported by: 0

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.

func (*Varint) DeserializeReader

func (i *Varint) DeserializeReader(b io.Reader) error

func (Varint) Serialize

func (i Varint) Serialize() []byte

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

type Varstring

type Varstring string

Variable length string can be stored using a variable length integer followed by the string itself.

func (*Varstring) DeserializeReader

func (str *Varstring) DeserializeReader(buf io.Reader) error

func (Varstring) Serialize

func (str Varstring) Serialize() []byte

Jump to

Keyboard shortcuts

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