package protocol
import "github.com/aws/aws-sdk-go-v2/private/protocol"
Index ¶
- Variables
- func CanSetIdempotencyToken(v reflect.Value, f reflect.StructField) bool
- func DecodeJSONValue(v string, escape EscapeMode) (aws.JSONValue, error)
- func EncodeJSONValue(v aws.JSONValue, escape EscapeMode) (string, error)
- func GetIdempotencyToken() string
- func GetValue(r reflect.Value) (string, error)
- func IsNotSetError(err error) bool
- func SetIdempotencyToken(v reflect.Value)
- func UUIDVersion4(u []byte) string
- func UnmarshalDiscardBody(r *request.Request)
- type ErrValueNotSet
- type EscapeMode
Variables ¶
RandReader is the random reader the protocol package will use to read random bytes from. This is exported for testing, and should not be used.
var UnmarshalDiscardBodyHandler = request.NamedHandler{Name: "awssdk.shared.UnmarshalDiscardBody", Fn: UnmarshalDiscardBody}
UnmarshalDiscardBodyHandler is a named request handler to empty and close a response's body
Functions ¶
func CanSetIdempotencyToken ¶
func CanSetIdempotencyToken(v reflect.Value, f reflect.StructField) bool
CanSetIdempotencyToken returns true if the struct field should be automatically populated with a Idempotency token.
Only *string and string type fields that are tagged with idempotencyToken which are not already set can be auto filled.
func DecodeJSONValue ¶
func DecodeJSONValue(v string, escape EscapeMode) (aws.JSONValue, error)
DecodeJSONValue will attempt to decode the string input as a JSONValue. Optionally decoding base64 the value first before JSON unmarshaling.
Will panic if the escape mode is unknown.
func EncodeJSONValue ¶
func EncodeJSONValue(v aws.JSONValue, escape EscapeMode) (string, error)
EncodeJSONValue marshals the value into a JSON string, and optionally base64 encodes the string before returning it.
Will panic if the escape mode is unknown.
func GetIdempotencyToken ¶
func GetIdempotencyToken() string
GetIdempotencyToken returns a randomly generated idempotency token.
func GetValue ¶
GetValue will return the value that is associated with the reflect.Value. If that value is not set, this will return an ErrValueNotSet
func IsNotSetError ¶
IsNotSetError will return true if the error is of ErrValueNotSet
func SetIdempotencyToken ¶
SetIdempotencyToken will set the value provided with a Idempotency Token. Given that the value can be set. Will panic if value is not setable.
func UUIDVersion4 ¶
UUIDVersion4 returns a Version 4 random UUID from the byte slice provided
func UnmarshalDiscardBody ¶
UnmarshalDiscardBody is a request handler to empty a response's body and closing it.
Types ¶
type ErrValueNotSet ¶
type ErrValueNotSet struct{}
ErrValueNotSet is an error that is returned when the value has not been set.
func (*ErrValueNotSet) Error ¶
func (err *ErrValueNotSet) Error() string
type EscapeMode ¶
type EscapeMode uint
EscapeMode is the mode that should be use for escaping a value
const ( NoEscape EscapeMode = iota Base64Escape QuotedEscape )
The modes for escaping a value before it is marshaled, and unmarshaled.
Source Files ¶
idempotency.go jsonvalue.go unmarshal.go value.go
Directories ¶
Path | Synopsis |
---|---|
private/protocol/ec2query | Package ec2query provides serialization of AWS EC2 requests and responses. |
private/protocol/json | |
private/protocol/json/jsonutil | Package jsonutil provides JSON serialization of AWS requests and responses. |
private/protocol/jsonrpc | Package jsonrpc provides JSON RPC utilities for serialization of AWS requests and responses. |
private/protocol/query | Package query provides serialization of AWS query requests, and responses. |
private/protocol/query/queryutil | |
private/protocol/rest | Package rest provides RESTful serialization of AWS requests and responses. |
private/protocol/restjson | Package restjson provides RESTful JSON serialization of AWS requests and responses. |
private/protocol/restxml | Package restxml provides RESTful XML serialization of AWS requests and responses. |
private/protocol/xml | |
private/protocol/xml/xmlutil | Package xmlutil provides XML serialization of AWS requests and responses. |
- Version
- v2.0.0-preview.1+incompatible
- Published
- Dec 21, 2017
- Platform
- linux/amd64
- Imports
- 9 packages
- Last checked
- 22 seconds ago –
Tools for package owners.