protocol

package
v1.14.29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RandReader = rand.Reader

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.

View Source
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 added in v1.12.30

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 added in v1.12.30

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 SetIdempotencyToken

func SetIdempotencyToken(v reflect.Value)

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

func UUIDVersion4(u []byte) string

UUIDVersion4 returns a Version 4 random UUID from the byte slice provided

func UnmarshalDiscardBody

func UnmarshalDiscardBody(r *request.Request)

UnmarshalDiscardBody is a request handler to empty a response's body and closing it.

Types

type EscapeMode added in v1.12.30

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.

type HandlerPayloadMarshal added in v1.14.0

type HandlerPayloadMarshal struct {
	Marshalers request.HandlerList
}

HandlerPayloadMarshal implements the PayloadMarshaler from a HandlerList. This provides support for marshaling a SDK shape into an io.Writer without needing a SDK request first.

func (HandlerPayloadMarshal) MarshalPayload added in v1.14.0

func (h HandlerPayloadMarshal) MarshalPayload(w io.Writer, v interface{}) error

MarshalPayload marshals the SDK shape into the io.Writer using the Marshalers HandlerList provided. Returns an error if unable if marshal fails.

type HandlerPayloadUnmarshal added in v1.14.0

type HandlerPayloadUnmarshal struct {
	Unmarshalers request.HandlerList
}

HandlerPayloadUnmarshal implements the PayloadUnmarshaler from a HandlerList. This provides the support for unmarshaling a payload reader to a shape without needing a SDK request first.

func (HandlerPayloadUnmarshal) UnmarshalPayload added in v1.14.0

func (h HandlerPayloadUnmarshal) UnmarshalPayload(r io.Reader, v interface{}) error

UnmarshalPayload unmarshals the io.Reader payload into the SDK shape using the Unmarshalers HandlerList provided. Returns an error if unable unmarshaling fails.

type PayloadMarshaler added in v1.14.0

type PayloadMarshaler interface {
	MarshalPayload(io.Writer, interface{}) error
}

PayloadMarshaler provides the interface for marshaling a SDK shape into and io.Writer.

type PayloadUnmarshaler added in v1.14.0

type PayloadUnmarshaler interface {
	UnmarshalPayload(io.Reader, interface{}) error
}

PayloadUnmarshaler provides the interface for unmarshaling a payload's reader into a SDK shape.

Directories

Path Synopsis
Package ec2query provides serialization of AWS EC2 requests and responses.
Package ec2query provides serialization of AWS EC2 requests and responses.
json
Package jsonrpc provides JSON RPC utilities for serialization of AWS requests and responses.
Package jsonrpc provides JSON RPC utilities for serialization of AWS requests and responses.
Package query provides serialization of AWS query requests, and responses.
Package query provides serialization of AWS query requests, and responses.
Package rest provides RESTful serialization of AWS requests and responses.
Package rest provides RESTful serialization of AWS requests and responses.
Package restjson provides RESTful JSON serialization of AWS requests and responses.
Package restjson provides RESTful JSON serialization of AWS requests and responses.
Package restxml provides RESTful XML serialization of AWS requests and responses.
Package restxml provides RESTful XML serialization of AWS requests and responses.
xml

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL