Documentation ¶
Index ¶
- type Encoder
- func (e *Encoder) AddHeader(key string) HeaderValue
- func (e *Encoder) AddQuery(key string) QueryValue
- func (e *Encoder) Encode() error
- func (e *Encoder) Headers(prefix string) Headers
- func (e *Encoder) SetHeader(key string) HeaderValue
- func (e *Encoder) SetQuery(key string) QueryValue
- func (e *Encoder) SetURI(key string) URIValue
- type HeaderValue
- func (h HeaderValue) Boolean(v bool)
- func (h HeaderValue) ByteSlice(v []byte)
- func (h HeaderValue) Float(v float64)
- func (h HeaderValue) Integer(v int64)
- func (h HeaderValue) JSONValue(v aws.JSONValue) error
- func (h HeaderValue) String(v string)
- func (h HeaderValue) Time(t time.Time, format string) error
- type Headers
- type QueryValue
- func (qv QueryValue) Boolean(v bool)
- func (qv QueryValue) ByteSlice(v []byte)
- func (qv QueryValue) Float(v float64)
- func (qv QueryValue) Integer(v int64)
- func (qv QueryValue) JSONValue(v aws.JSONValue) error
- func (qv QueryValue) String(v string)
- func (qv QueryValue) Time(v time.Time, format string) error
- type URIValue
- func (u URIValue) Boolean(v bool) error
- func (u URIValue) ByteSlice(v []byte) error
- func (u URIValue) Float(v float64) error
- func (u URIValue) Integer(v int64) error
- func (u URIValue) JSONValue(v aws.JSONValue) error
- func (u URIValue) String(v string) error
- func (u URIValue) Time(v time.Time, format string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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) AddHeader ¶
func (e *Encoder) AddHeader(key string) HeaderValue
AddHeader returns a HeaderValue for appending to the given header name
func (*Encoder) AddQuery ¶
func (e *Encoder) AddQuery(key string) QueryValue
AddQuery returns a QueryValue used for appending the given query key
func (*Encoder) Encode ¶
Encode returns a REST protocol encoder for encoding HTTP bindings Returns any error if one occurred during encoding.
func (*Encoder) SetHeader ¶
func (e *Encoder) SetHeader(key string) HeaderValue
SetHeader returns a HeaderValue for setting the given header name
func (*Encoder) SetQuery ¶
func (e *Encoder) SetQuery(key string) QueryValue
SetQuery returns a QueryValue used for setting the given query key
type HeaderValue ¶
type HeaderValue struct {
// contains filtered or unexported fields
}
HeaderValue is used to encode values to an HTTP header
func (HeaderValue) Boolean ¶
func (h HeaderValue) Boolean(v bool)
Boolean encodes the value v as a header string value
func (HeaderValue) ByteSlice ¶
func (h HeaderValue) ByteSlice(v []byte)
ByteSlice encodes the value v as a base64 header string value
func (HeaderValue) Float ¶
func (h HeaderValue) Float(v float64)
Float encodes the value v as a header string value
func (HeaderValue) Integer ¶
func (h HeaderValue) Integer(v int64)
Integer encodes the value v as the header string value
func (HeaderValue) JSONValue ¶
func (h HeaderValue) JSONValue(v aws.JSONValue) error
JSONValue encodes the value v as a base64 header string value
func (HeaderValue) String ¶
func (h HeaderValue) String(v string)
String encodes the value v as the header string value
type Headers ¶
type Headers struct {
// contains filtered or unexported fields
}
Headers is used to encode header keys using a provided prefix
func (Headers) AddHeader ¶
func (h Headers) AddHeader(key string) HeaderValue
AddHeader returns a HeaderValue used to append values to prefix+key
func (Headers) SetHeader ¶
func (h Headers) SetHeader(key string) HeaderValue
SetHeader returns a HeaderValue used to set the value of prefix+key
type QueryValue ¶
type QueryValue struct {
// contains filtered or unexported fields
}
QueryValue is used to encode query key values
func (QueryValue) Boolean ¶
func (qv QueryValue) Boolean(v bool)
Boolean encodes the value v as a query string value
func (QueryValue) ByteSlice ¶
func (qv QueryValue) ByteSlice(v []byte)
ByteSlice encodes the value v as a base64 query string value
func (QueryValue) Float ¶
func (qv QueryValue) Float(v float64)
Float encodes the value v as a query string value
func (QueryValue) Integer ¶
func (qv QueryValue) Integer(v int64)
Integer encodes the value v as a query string value
func (QueryValue) JSONValue ¶
func (qv QueryValue) JSONValue(v aws.JSONValue) error
JSONValue encodes the value v using the format name as a query string value
func (QueryValue) String ¶
func (qv QueryValue) String(v string)
String encodes the value v as a query string value
type URIValue ¶
type URIValue struct {
// contains filtered or unexported fields
}
URIValue is used to encode named URI parameters