Documentation ¶
Index ¶
- func MustMarshal(i interface{}) []byte
- type JSONMarshaler
- func (j *JSONMarshaler) ContentType() string
- func (j *JSONMarshaler) Marshal(v interface{}) ([]byte, error)
- func (j *JSONMarshaler) NewDecoder(r io.Reader) gwruntime.Decoder
- func (j *JSONMarshaler) NewEncoder(w io.Writer) gwruntime.Encoder
- func (j *JSONMarshaler) Unmarshal(data []byte, v interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustMarshal ¶
func MustMarshal(i interface{}) []byte
MustMarshal marshals an object and panics if it failures. This function should only be used when the object being passed in does not have any chance of failing (i.e. you constructed the object yourself)
Types ¶
type JSONMarshaler ¶
type JSONMarshaler struct{}
JSONMarshaler is a type which satisfies the grpc-gateway Marshaler interface
func (*JSONMarshaler) ContentType ¶
func (j *JSONMarshaler) ContentType() string
ContentType implements gwruntime.Marshaler.
func (*JSONMarshaler) Marshal ¶
func (j *JSONMarshaler) Marshal(v interface{}) ([]byte, error)
Marshal implements gwruntime.Marshaler.
func (*JSONMarshaler) NewDecoder ¶
func (j *JSONMarshaler) NewDecoder(r io.Reader) gwruntime.Decoder
NewDecoder implements gwruntime.Marshaler.
func (*JSONMarshaler) NewEncoder ¶
func (j *JSONMarshaler) NewEncoder(w io.Writer) gwruntime.Encoder
NewEncoder implements gwruntime.Marshaler.
func (*JSONMarshaler) Unmarshal ¶
func (j *JSONMarshaler) Unmarshal(data []byte, v interface{}) error
Unmarshal implements gwruntime.Marshaler.
Click to show internal directories.
Click to hide internal directories.