Documentation
¶
Overview ¶
A plugin for marshaling and umarshaling protocol buffers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultJSONConfig = &JSONConfig{}
)
View Source
var DefaultProtoConfig = &ProtoConfig{}
Functions ¶
func AsJSON ¶
func AsJSON(pb proto.Message) hx.ResponseHandler
AsJSON is hx.ResponseHandler for unmarshaling response bodies as JSON. This will unmarshal a received data with jsonpb.Unmarshaler in default.
func AsProto ¶
func AsProto(pb proto.Message) hx.ResponseHandler
AsProto is hx.ResponseHandler for unmarshaling response bodies as Proto. This will unmarshal a received data with proto.Unmarshal marshaler in default.
Types ¶
type JSONConfig ¶
type JSONConfig struct { jsonpb.Marshaler jsonpb.Unmarshaler EncodeFunc func(proto.Message) (io.Reader, error) DecodeFunc func(io.Reader, proto.Message) error }
func (*JSONConfig) AsJSON ¶
func (c *JSONConfig) AsJSON(pb proto.Message) hx.ResponseHandler
Click to show internal directories.
Click to hide internal directories.