Documentation ¶
Index ¶
- func Decode(data []byte, dec Decoder) (interface{}, error)
- func Encode(s interface{}, enc Encoder) ([]byte, error)
- func Equal(a []byte, b []byte) bool
- func FromHex(data string) ([]byte, error)
- func FromInt16(v int16) []byte
- func FromInt32(v int32) []byte
- func FromInt64(v int64) []byte
- func FromUint16(v uint16) []byte
- func FromUint32(v uint32) []byte
- func FromUint64(v uint64) []byte
- func Hex(data []byte) string
- func Int16(data []byte) int16
- func Int32(data []byte) int32
- func Int64(data []byte) int64
- func Uint16(data []byte) uint16
- func Uint32(data []byte) uint32
- func Uint64(data []byte) uint64
- func ZeroBytes(bytes []byte)
- type Decoder
- type Encoder
- type JSONSerializer
- type ProtoSerializer
- type Serializable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type JSONSerializer ¶
type JSONSerializer struct{}
JSONSerializer implements conversion between bytes and json string.
func (*JSONSerializer) Deserialize ¶
func (s *JSONSerializer) Deserialize(val []byte, res interface{}) error
Deserialize converts json string into struct or array.
func (*JSONSerializer) Serialize ¶
func (s *JSONSerializer) Serialize(val interface{}) ([]byte, error)
Serialize converts struct or array into json string.
type ProtoSerializer ¶
type ProtoSerializer struct{}
ProtoSerializer implements conversion between bytes and proto message.
func (*ProtoSerializer) Deserialize ¶
func (s *ProtoSerializer) Deserialize(val []byte, res proto.Message) error
Deserialize converts byte into proto message.
Click to show internal directories.
Click to hide internal directories.