Documentation ¶
Overview ¶
Package rest provides RESTful serialization of AWS requests and responses.
Index ¶
- Constants
- Variables
- func Build(r *request.Request)
- func BuildAsGET(r *request.Request)
- func EscapePath(path string, encodeSep bool) string
- func PayloadMember(i interface{}) interface{}
- func PayloadType(i interface{}) string
- func Unmarshal(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 ¶
const RFC822 = "Mon, 2 Jan 2006 15:04:05 GMT"
RFC822 returns an RFC822 formatted timestamp for AWS protocols
Variables ¶
var BuildHandler = request.NamedHandler{Name: "awssdk.rest.Build", Fn: Build}
BuildHandler is a named request handler for building rest protocol requests
var UnmarshalHandler = request.NamedHandler{Name: "awssdk.rest.Unmarshal", Fn: Unmarshal}
UnmarshalHandler is a named request handler for unmarshaling rest protocol requests
var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.rest.UnmarshalMeta", Fn: UnmarshalMeta}
UnmarshalMetaHandler is a named request handler for unmarshaling rest protocol request metadata
Functions ¶
func BuildAsGET ¶
BuildAsGET builds the REST component of a service request with the ability to hoist data from the body.
func EscapePath ¶
EscapePath escapes part of a URL path in Amazon style
func PayloadMember ¶
func PayloadMember(i interface{}) interface{}
PayloadMember returns the payload field member of i if there is one, or nil.
func PayloadType ¶
func PayloadType(i interface{}) string
PayloadType returns the type of a payload field member of i if there is one, or "".
func UnmarshalMeta ¶
UnmarshalMeta unmarshals the REST metadata of a response in a REST service
Types ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
An Encoder provides encoding of REST URI path, query, and header components of an HTTP request. Can also encode a stream as the payload.
Does not support SetFields.
func NewEncoder ¶
NewEncoder creates a new encoder from the passed in request. All query and header values will be added on top of the request's existing values. Overwriting duplicate values.
func (*Encoder) Encode ¶
Encode will return the request and body if one was set. If the body payload was not set the io.ReadSeeker will be nil.
returns any error if one occured while encoding the API's parameters.
func (*Encoder) SetFields ¶
func (e *Encoder) SetFields(t protocol.Target, k string, m protocol.FieldMarshaler, meta protocol.Metadata)
SetFields is not supported for REST encoder.