Documentation
¶
Index ¶
- Constants
- func Decode(data []byte) []interface{}
- func DecodeStruct(data []byte, target interface{}) error
- func DecodeToProtoStruct(data []ProtoPart, target interface{}) error
- func Encode(data []interface{}) []byte
- func EncodeProto(parts []ProtoPart) []byte
- func EncodeStruct(data interface{}) []byte
- func ProtoPartsToArray(parts []ProtoPart) []interface{}
- type ProtoDecoded
- type ProtoPart
- type ZigZag
Constants ¶
View Source
const ( VARINT = 0x00 FIXED64 = 0x01 LENDELIM = 0x02 FIXED32 = 0x05 )
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
func Decode(data []byte) []interface{}
A simple wrapper to decode data, it doesn't check for errors/field numbers or even leftover bytes if there are any, it is unadvised to use it, just accomodate yourself to the functions it uses
func DecodeStruct ¶
func DecodeToProtoStruct ¶
Target should be a pointer to a struct
func Encode ¶
func Encode(data []interface{}) []byte
A simple wrapper to encode data, it doesn't check for errors/field numbers or anything else so it is unadvised to use it, just accomodate yourself to the functions it uses
func EncodeProto ¶
func EncodeStruct ¶
func EncodeStruct(data interface{}) []byte
func ProtoPartsToArray ¶
func ProtoPartsToArray(parts []ProtoPart) []interface{}
Types ¶
type ProtoDecoded ¶
func DecodeProto ¶
func DecodeProto(data []byte) ProtoDecoded
type ProtoPart ¶
func ArrayToProtoParts ¶
func ArrayToProtoParts(data []interface{}) []ProtoPart
func EncodeProtoStruct ¶
func EncodeProtoStruct(data interface{}) []ProtoPart
type ZigZag ¶
type ZigZag struct{}
func (*ZigZag) DecodeSint32 ¶
DecodeSint32 decodes a zigzag-encoded uint64 value into an int32 value.
func (*ZigZag) EncodeInt32 ¶
EncodeInt32 encodes an int32 value into a zigzag-encoded uint64 value.
Click to show internal directories.
Click to hide internal directories.