Documentation ¶
Index ¶
- Variables
- func Decode(value interface{}, r io.Reader) error
- func DecodeBytes(value interface{}, data []byte) error
- func Encode(value interface{}, w io.Writer) error
- func EncodeBytes(value interface{}) ([]byte, error)
- type Marshaller
- type Reader
- type String
- type Unmarshaller
- type Varint
- type Varlong
- type Writer
Constants ¶
This section is empty.
Variables ¶
var ErrNotPointer = errors.New("given value is not a pointer")
ErrNotPointer ...
Functions ¶
func DecodeBytes ¶
DecodeBytes is used for decoding data which is stored in a byte array
func EncodeBytes ¶
EncodeBytes will encode the given struct or value and return it in the bytes array
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader for wrapping any io.Reader and implementing io.ByteReader for it
type String ¶
type String string
String is a sequence of Unicode scalar values UTF-8 string prefixed with its size in bytes as a VarInt. Maximum length of n characters, which varies by context; up to n × 4 bytes can be used to encode n characters and both of those limits are checked. Maximum n value is 32767. The + 3 is due to the max size of a valid length VarInt.
func (String) RawMarshal ¶
RawMarshal is used by rawbin to encode the data
func (*String) RawUnmarshal ¶
RawUnmarshal is used by rawbin to decode the data
type Unmarshaller ¶
Unmarshaller ...
type Varint ¶
type Varint int32
Varint is an integer between -2147483648 and 2147483647 Variable-length data encoding a two's complement signed 32-bit integer
func (Varint) RawMarshal ¶
RawMarshal is used by rawbin to encode the data
func (*Varint) RawUnmarshal ¶
RawUnmarshal is used by rawbin to decode the data TODO: Might need to write the reader because binary.ReadVarint is meant to read int64 and not int32 so it might read more then needed
type Varlong ¶
type Varlong int64
Varlong is an integer between -9223372036854775808 and 9223372036854775807 Variable-length data encoding a two's complement signed 64-bit integer
func (Varlong) RawMarshal ¶
RawMarshal is used by rawbin to encode the data
func (*Varlong) RawUnmarshal ¶
RawUnmarshal is used by rawbin to decode the data