Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrWrongValueType = cherryUtils.Error("protobuf: convert on wrong type value")
)
Functions ¶
This section is empty.
Types ¶
type JSONSerializer ¶
type JSONSerializer struct{}
func NewJSON ¶
func NewJSON() *JSONSerializer
func (*JSONSerializer) Marshal ¶
func (j *JSONSerializer) Marshal(v interface{}) ([]byte, error)
Marshal returns the JSON encoding of v.
func (*JSONSerializer) Name ¶
func (j *JSONSerializer) Name() string
Name returns the name of the serializer.
func (*JSONSerializer) Unmarshal ¶
func (j *JSONSerializer) Unmarshal(data []byte, v interface{}) error
Unmarshal parses the JSON-encoded data and stores the result in the value pointed to by v.
type ProtobufSerializer ¶
type ProtobufSerializer struct{}
ProtobufSerializer implements the serialize.ProtobufSerializer interface
func NewProtobuf ¶
func NewProtobuf() *ProtobufSerializer
NewSerializer returns a new ProtobufSerializer.
func (*ProtobufSerializer) Marshal ¶
func (p *ProtobufSerializer) Marshal(v interface{}) ([]byte, error)
Marshal returns the protobuf encoding of v.
func (*ProtobufSerializer) Name ¶
func (p *ProtobufSerializer) Name() string
Name returns the name of the serializer.
func (*ProtobufSerializer) Unmarshal ¶
func (p *ProtobufSerializer) Unmarshal(data []byte, v interface{}) error
Unmarshal parses the protobuf-encoded data and stores the result in the value pointed to by v.
Click to show internal directories.
Click to hide internal directories.