Documentation ¶
Index ¶
- func NewHTTPBodyJsonMarshaler(options ...JSONPbOption) runtime.Marshaler
- func NewHTTPBodyProtoMarshaler() runtime.Marshaler
- func NewHTTPBodyYamlMarshaler() runtime.Marshaler
- type DecoderWrapper
- type EmptyHTTPBodyPbOption
- type EmptyJSONPbOption
- type HTTPBodyPb
- type HTTPBodyPbOption
- type HTTPBodyPbOptionFunc
- type JSONPb
- type JSONPbOption
- type JSONPbOptionFunc
- type ProtoMarshaller
- type StatusHandler
- type YamlDecoderWrapper
- type YamlMarshaller
- func (*YamlMarshaller) ContentType() string
- func (*YamlMarshaller) Marshal(v interface{}) ([]byte, error)
- func (*YamlMarshaller) NewDecoder(r io.Reader) runtime.Decoder
- func (*YamlMarshaller) NewEncoder(w io.Writer) runtime.Encoder
- func (y *YamlMarshaller) Unmarshal(data []byte, v interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPBodyJsonMarshaler ¶
func NewHTTPBodyJsonMarshaler(options ...JSONPbOption) runtime.Marshaler
Types ¶
type DecoderWrapper ¶
type DecoderWrapper struct {
// contains filtered or unexported fields
}
DecoderWrapper is a wrapper around a *json.Decoder that adds support for proto and json to the Decode method.
func (DecoderWrapper) Decode ¶
func (d DecoderWrapper) Decode(v interface{}) error
Decode wraps the embedded decoder's Decode method to support protos using a jsonpb.Unmarshaler.
type EmptyHTTPBodyPbOption ¶
type EmptyHTTPBodyPbOption struct{}
EmptyHTTPBodyPbOption does not alter the configuration. It can be embedded in another structure to build custom options.
This API is EXPERIMENTAL.
type EmptyJSONPbOption ¶
type EmptyJSONPbOption struct{}
EmptyJSONPbOption does not alter the configuration. It can be embedded in another structure to build custom options.
This API is EXPERIMENTAL.
type HTTPBodyPb ¶
type HTTPBodyPb runtime.HTTPBodyMarshaler
HTTPBodyPb is a Marshaler which supports marshaling of a google.api.HttpBody message as the full response body if it is the actual message used as the response. If not, then this will simply fallback to the Marshaler specified as its default Marshaler.
func (*HTTPBodyPb) ApplyOptions ¶
func (o *HTTPBodyPb) ApplyOptions(options ...HTTPBodyPbOption) *HTTPBodyPb
type HTTPBodyPbOption ¶
type HTTPBodyPbOption interface {
// contains filtered or unexported methods
}
A HTTPBodyPbOption sets options.
func WithMarshaler ¶
func WithMarshaler(marshaler runtime.Marshaler) HTTPBodyPbOption
Whether to render enum values as integers, as opposed to string values.
type HTTPBodyPbOptionFunc ¶
type HTTPBodyPbOptionFunc func(*HTTPBodyPb)
HTTPBodyPbOptionFunc wraps a function that modifies HTTPBodyPb into an implementation of the HTTPBodyPbOption interface.
type JSONPb ¶
json -> proto|interface{}
func (*JSONPb) ApplyOptions ¶
func (o *JSONPb) ApplyOptions(options ...JSONPbOption) *JSONPb
func (*JSONPb) NewDecoder ¶
NewDecoder returns a Decoder which reads JSON stream from "r".
func (*JSONPb) NewEncoder ¶
NewEncoder returns an Encoder which writes JSON stream into "w".
type JSONPbOption ¶
type JSONPbOption interface {
// contains filtered or unexported methods
}
A JSONPbOption sets options.
func WithEmitAsInts ¶
func WithEmitAsInts(enumsAsInts bool) JSONPbOption
Whether to render enum values as integers, as opposed to string values.
func WithEmitDefaults ¶
func WithEmitDefaults(emitDefaults bool) JSONPbOption
Whether to render fields with zero values.
func WithIndent ¶
func WithIndent(indent string) JSONPbOption
A string to indent each level by. The presence of this field will also cause a space to appear between the field separator and value, and for newlines to be appear between fields and array elements.
func WithOrigName ¶
func WithOrigName(origName bool) JSONPbOption
Whether to use the original (.proto) name for fields.
type JSONPbOptionFunc ¶
type JSONPbOptionFunc func(*JSONPb)
JSONPbOptionFunc wraps a function that modifies JSONPb into an implementation of the JSONPbOption interface.
type ProtoMarshaller ¶
type ProtoMarshaller struct {
runtime.ProtoMarshaller
}
[]byte -> proto|interface{}
func (*ProtoMarshaller) ContentType ¶
func (*ProtoMarshaller) ContentType() string
ContentType always returns "application/x-protobuf".
type StatusHandler ¶
type YamlDecoderWrapper ¶
type YamlDecoderWrapper struct {
// contains filtered or unexported fields
}
DecoderWrapper is a wrapper around a *json.Decoder that adds support for proto and json to the Decode method.
func (YamlDecoderWrapper) Decode ¶
func (d YamlDecoderWrapper) Decode(v interface{}) error
Decode wraps the embedded decoder's Decode method to support protos using a jsonpb.Unmarshaler.
type YamlMarshaller ¶
type YamlMarshaller struct {
runtime.ProtoMarshaller
}
[]byte -> proto|interface{}
func (*YamlMarshaller) ContentType ¶
func (*YamlMarshaller) ContentType() string
ContentType returns the Content-Type which this marshaler is responsible for.
func (*YamlMarshaller) Marshal ¶
func (*YamlMarshaller) Marshal(v interface{}) ([]byte, error)
Marshal marshals "v" into byte sequence.
func (*YamlMarshaller) NewDecoder ¶
func (*YamlMarshaller) NewDecoder(r io.Reader) runtime.Decoder
NewDecoder returns a Decoder which reads byte sequence from "r".
func (*YamlMarshaller) NewEncoder ¶
func (*YamlMarshaller) NewEncoder(w io.Writer) runtime.Encoder
NewEncoder returns an Encoder which writes bytes sequence into "w".
func (*YamlMarshaller) Unmarshal ¶
func (y *YamlMarshaller) Unmarshal(data []byte, v interface{}) error
Unmarshal unmarshals "data" into "v". "v" must be a pointer value.