Documentation ¶
Overview ¶
Package aws contains support code for the various AWS clients in the github.com/awslabs/aws-sdk-go/gen subpackages.
Index ¶
- Variables
- func EscapePath(path string) string
- func MarshalXML(v interface{}, e *xml.Encoder, start xml.StartElement) error
- type APIError
- type BooleanValue
- type Context
- type Credentials
- type CredentialsProvider
- func Creds(accessKeyID, secretAccessKey, securityToken string) CredentialsProvider
- func DetectCreds(accessKeyID, secretAccessKey, securityToken string) CredentialsProvider
- func EnvCreds() (CredentialsProvider, error)
- func IAMCreds() CredentialsProvider
- func ProfileCreds(filename, profile string, expiry time.Duration) (CredentialsProvider, error)
- type DoubleValue
- type EC2Client
- type FloatValue
- type IntegerValue
- type JSONClient
- type LongValue
- type QueryClient
- type RestClient
- type StringValue
- type UnixTimestamp
Constants ¶
This section is empty.
Variables ¶
var ( // ErrAccessKeyIDNotFound is returned when the AWS Access Key ID can't be // found in the process's environment. ErrAccessKeyIDNotFound = fmt.Errorf("AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment") // ErrSecretAccessKeyNotFound is returned when the AWS Secret Access Key // can't be found in the process's environment. ErrSecretAccessKeyNotFound = fmt.Errorf("AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY not found in environment") )
var IAMClient = http.Client{ Timeout: 1 * time.Second, }
IAMClient is the HTTP client used to query the metadata endpoint for IAM credentials.
Functions ¶
func EscapePath ¶
EscapePath escapes part of a URL path in Amazon style
func MarshalXML ¶
func MarshalXML(v interface{}, e *xml.Encoder, start xml.StartElement) error
MarshalXML is a weird and stunted version of xml.Marshal which is used by the REST-XML request types to get around a bug in encoding/xml which doesn't allow us to marshal pointers to zero values:
Types ¶
type APIError ¶
type APIError struct { StatusCode int // HTTP status code e.g. 200 Type string Code string Message string RequestID string HostID string Specifics map[string]string }
An APIError is an error returned by an AWS API.
type BooleanValue ¶
type BooleanValue *bool
A BooleanValue is a boolean which may or may not be present.
func False ¶
func False() BooleanValue
False is the BooleanValue equivalent of the Go literal false.
type Context ¶
type Context struct { Service string Region string Credentials CredentialsProvider }
Context encapsulates the context of a client's connection to an AWS service.
type Credentials ¶
Credentials are used to authenticate and authorize calls that you make to AWS.
type CredentialsProvider ¶
type CredentialsProvider interface { // Credentials returns a set of credentials (or an error if no credentials // could be provided). Credentials() (*Credentials, error) }
A CredentialsProvider is a provider of credentials.
func Creds ¶
func Creds(accessKeyID, secretAccessKey, securityToken string) CredentialsProvider
Creds returns a static provider of credentials.
func DetectCreds ¶
func DetectCreds(accessKeyID, secretAccessKey, securityToken string) CredentialsProvider
DetectCreds returns a CredentialsProvider based on the available information.
If the access key ID and secret access key are provided, it returns a basic provider.
If credentials are available via environment variables, it returns an environment provider.
If a profile configuration file is available in the default location and has a default profile configured, it returns a profile provider.
Otherwise, it returns an IAM instance provider.
func EnvCreds ¶
func EnvCreds() (CredentialsProvider, error)
EnvCreds returns a static provider of AWS credentials from the process's environment, or an error if none are found.
func IAMCreds ¶
func IAMCreds() CredentialsProvider
IAMCreds returns a provider which pulls credentials from the local EC2 instance's IAM roles.
func ProfileCreds ¶
func ProfileCreds(filename, profile string, expiry time.Duration) (CredentialsProvider, error)
ProfileCreds returns a provider which pulls credentials from the profile configuration file.
type DoubleValue ¶
type DoubleValue *float64
A DoubleValue is a 64-bit floating point number which may or may not be present.
type FloatValue ¶
type FloatValue *float32
A FloatValue is a 32-bit floating point number which may or may not be present.
type IntegerValue ¶
type IntegerValue *int
An IntegerValue is an integer which may or may not be present.
type JSONClient ¶
type JSONClient struct { Context Context Client *http.Client Endpoint string TargetPrefix string JSONVersion string }
JSONClient is the underlying client for JSON APIs.
func (*JSONClient) Do ¶
func (c *JSONClient) Do(op, method, uri string, req, resp interface{}) error
Do sends an HTTP request and returns an HTTP response, following policy (e.g. redirects, cookies, auth) as configured on the client.
type LongValue ¶
type LongValue *int64
A LongValue is a 64-bit integer which may or may not be present.
type QueryClient ¶
QueryClient is the underlying client for Query APIs.
func (*QueryClient) Do ¶
func (c *QueryClient) Do(op, method, uri string, req, resp interface{}) error
Do sends an HTTP request and returns an HTTP response, following policy (e.g. redirects, cookies, auth) as configured on the client.
type RestClient ¶
RestClient is the underlying client for REST-JSON and REST-XML APIs.
type StringValue ¶
type StringValue *string
A StringValue is a string which may or may not be present.
type UnixTimestamp ¶
A UnixTimestamp is a Unix timestamp represented as fractional seconds since the Unix epoch.
func (UnixTimestamp) MarshalJSON ¶
func (t UnixTimestamp) MarshalJSON() (text []byte, err error)
MarshalJSON marshals the timestamp as a float.
func (*UnixTimestamp) UnmarshalJSON ¶
func (t *UnixTimestamp) UnmarshalJSON(text []byte) error
UnmarshalJSON unmarshals the timestamp from a float.