Documentation ¶
Index ¶
Constants ¶
View Source
const JSONContentType = "application/json"
View Source
const ProtobufContentType = "application/x-protobuf"
Variables ¶
View Source
var DefaultMarshallerRegistry = map[string]Marshaller{}
View Source
var JSONMarshaller = &JsonMarshaller{}
View Source
var ProtobufMarshaller = &ProtoMarshaller{}
Functions ¶
func RegisterMarshaller ¶
func RegisterMarshaller(marshaller Marshaller)
Types ¶
type JsonMarshaller ¶
type JsonMarshaller struct { }
func (*JsonMarshaller) ContentType ¶
func (j *JsonMarshaller) ContentType() string
func (*JsonMarshaller) Marshal ¶
func (j *JsonMarshaller) Marshal(v interface{}) ([]byte, error)
func (*JsonMarshaller) Unmarshal ¶
func (j *JsonMarshaller) Unmarshal(data []byte, v interface{}) error
type Marshaller ¶
type ProtoMarshaller ¶
type ProtoMarshaller struct { }
func (*ProtoMarshaller) ContentType ¶
func (p *ProtoMarshaller) ContentType() string
func (*ProtoMarshaller) Marshal ¶
func (p *ProtoMarshaller) Marshal(v interface{}) ([]byte, error)
func (*ProtoMarshaller) Unmarshal ¶
func (p *ProtoMarshaller) Unmarshal(data []byte, v interface{}) error
Click to show internal directories.
Click to hide internal directories.