Decoder is a Smithy document decoder for JSON based protocols.
type Decoder struct {
// contains filtered or unexported fields
}
func NewDecoder(optFns ...func(*DecoderOptions)) *Decoder
NewDecoder returns a Decoder for deserializing Smithy documents for JSON based protocols.
func (d *Decoder) DecodeJSONInterface(input interface{}, toValue interface{}) error
DecodeJSONInterface decodes the supported JSON input types and stores the result in the value pointed by toValue.
If toValue is not a compatible type, or an error occurs while decoding DecodeJSONInterface will return an error.
The supported input JSON types are:
bool -> JSON boolean float64 -> JSON number json.Number -> JSON number string -> JSON string []interface{} -> JSON array map[string]interface{} -> JSON object nil -> JSON null
DecoderOptions is the set of options that can be configured for a Decoder.
type DecoderOptions struct{}
Encoder is a Smithy document decoder for JSON based protocols.
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder(optFns ...func(options *EncoderOptions)) *Encoder
NewEncoder returns an Encoder for serializing Smithy documents for JSON based protocols.
func (e *Encoder) Encode(v interface{}) ([]byte, error)
Encode returns the JSON encoding of v.
EncoderOptions is the set of options that can be configured for an Encoder.
type EncoderOptions struct{}