Documentation ¶
Overview ¶
Package restjson provides RESTful JSON serialization of AWS requests and responses.
Index ¶
- Variables
- func Build(r *request.Request)
- func Unmarshal(r *request.Request)
- func UnmarshalError(r *request.Request)
- func UnmarshalMeta(r *request.Request)
- type Encoder
- func (e *Encoder) Encode() (*http.Request, io.ReadSeeker, error)
- func (e *Encoder) List(t protocol.Target, k string, meta protocol.Metadata) protocol.ListEncoder
- func (e *Encoder) Map(t protocol.Target, k string, meta protocol.Metadata) protocol.MapEncoder
- func (e *Encoder) SetFields(t protocol.Target, k string, m protocol.FieldMarshaler, meta protocol.Metadata)
- func (e *Encoder) SetStream(t protocol.Target, k string, v protocol.StreamMarshaler, ...)
- func (e *Encoder) SetValue(t protocol.Target, k string, v protocol.ValueMarshaler, meta protocol.Metadata)
Constants ¶
This section is empty.
Variables ¶
var BuildHandler = request.NamedHandler{Name: "awssdk.restjson.Build", Fn: Build}
BuildHandler is a named request handler for building restjson protocol requests
var UnmarshalErrorHandler = request.NamedHandler{Name: "awssdk.restjson.UnmarshalError", Fn: UnmarshalError}
UnmarshalErrorHandler is a named request handler for unmarshaling restjson protocol request errors
var UnmarshalHandler = request.NamedHandler{Name: "awssdk.restjson.Unmarshal", Fn: Unmarshal}
UnmarshalHandler is a named request handler for unmarshaling restjson protocol requests
var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.restjson.UnmarshalMeta", Fn: UnmarshalMeta}
UnmarshalMetaHandler is a named request handler for unmarshaling restjson protocol request metadata
Functions ¶
func UnmarshalError ¶
UnmarshalError unmarshals a response error for the REST JSON protocol.
func UnmarshalMeta ¶
UnmarshalMeta unmarshals response headers for the REST JSON protocol.
Types ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
An Encoder provides encoding of the AWS RESTJSON protocol. This encoder combindes the JSON and REST encoders deligating to them for their associated targets.
It is invalid to set a JSON and stream payload on the same encoder.
func NewEncoder ¶
NewEncoder creates a new encoder for encoding the AWS RESTJSON protocol. The request passed in will be the base the path, query, and headers encoded will be set on top of.
func (*Encoder) Encode ¶
Encode returns the encoded request, and body payload. If no payload body was set nil will be returned. If an error occurred while encoding the API an error will be returned.
func (*Encoder) SetFields ¶
func (e *Encoder) SetFields(t protocol.Target, k string, m protocol.FieldMarshaler, meta protocol.Metadata)
SetFields will set the nested type's fields to the body.