Documentation ¶
Overview ¶
Package gateway contains marshaling code extracted from github.com/grpc-ecosystem/grpc-gateway/runtime and altered to depend on gogo versions of the proto and jsonpb packages.
Index ¶
- type JSONPb
- func (*JSONPb) ContentType() string
- func (j *JSONPb) Delimiter() []byte
- func (j *JSONPb) Marshal(v interface{}) ([]byte, error)
- func (j *JSONPb) NewDecoder(r io.Reader) runtime.Decoder
- func (j *JSONPb) NewEncoder(w io.Writer) runtime.Encoder
- func (j *JSONPb) Unmarshal(data []byte, v interface{}) error
- type Proto
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONPb ¶
JSONPb is a runtime.Marshaler which marshals/unmarshals into/from JSON with "github.com/gogo/protobuf/jsonpb".
func (*JSONPb) ContentType ¶
ContentType always returns "application/json".
func (*JSONPb) NewDecoder ¶
NewDecoder returns a runtime.Decoder which reads JSON stream from "r".
func (*JSONPb) NewEncoder ¶
NewEncoder returns an Encoder which writes JSON stream into "w".
type Proto ¶
type Proto struct { // CustomContentType overrides the default Content-Type // of "application/octet-stream". CustomContentType string }
Proto is a runtime.Marshaller which marshals/unmarshals into/from serialize proto bytes
func (*Proto) ContentType ¶
ContentType returns the Content-Type. If CustomContentType is empty, it returns "application/octet-stream".
func (*Proto) NewDecoder ¶
NewDecoder returns a Decoder which reads proto stream from "reader".
func (*Proto) NewEncoder ¶
NewEncoder returns an Encoder which writes proto stream into "writer".