Documentation ¶
Overview ¶
Package codec
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterSerializer ¶
func RegisterSerializer(serializationType string, s Serializer)
Types ¶
type JSONSerialization ¶
type JSONSerialization struct{}
func (*JSONSerialization) Marshal ¶
func (s *JSONSerialization) Marshal(body interface{}) ([]byte, error)
func (*JSONSerialization) Unmarshal ¶
func (s *JSONSerialization) Unmarshal(in []byte, body interface{}) error
type ProtobufSerialization ¶
type ProtobufSerialization struct{}
func (*ProtobufSerialization) Marshal ¶
func (p *ProtobufSerialization) Marshal(body interface{}) (out []byte, err error)
func (*ProtobufSerialization) Unmarshal ¶
func (p *ProtobufSerialization) Unmarshal(in []byte, body interface{}) error
type Serializer ¶
type Serializer interface { Unmarshal(in []byte, body interface{}) error Marshal(body interface{}) (out []byte, err error) }
func GetSerializer ¶
func GetSerializer(serializationType string) Serializer
Click to show internal directories.
Click to hide internal directories.