Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ProtoMarshal = protojson.MarshalOptions{UseProtoNames: true, EmitUnpopulated: true}.Marshal ProtoUnmarshal = protojson.UnmarshalOptions{}.Unmarshal )
View Source
var ContentType2EncodingType = map[string]ContentEncodingType{ "application/json": EncodingTypeJson, "application/x-protobuf": EncodingTypeProtobuf, }
View Source
var EncodingType2ContentType = map[ContentEncodingType]string{ EncodingTypeJson: "application/json", EncodingTypeProtobuf: "application/x-protobuf", }
Functions ¶
func SerializeTo ¶
func SerializeTo(response proto.Message, encodingType ContentEncodingType) (content string, err error)
Types ¶
type ContentEncodingType ¶
type ContentEncodingType int
const ( EncodingTypeUnknown ContentEncodingType = iota + 1 EncodingTypeJson EncodingTypeProtobuf )
func DeserializeFrom ¶
func DeserializeFrom(in io.ReadCloser, request proto.Message, contentType string) (ContentEncodingType, error)
Click to show internal directories.
Click to hide internal directories.