Documentation ¶
Overview ¶
Package aws provides core functionality for making requests to AWS services.
Index ¶
- Constants
- Variables
- func Bool(v bool) *bool
- func BoolMap(src map[string]bool) map[string]*bool
- func BoolSlice(src []bool) []*bool
- func BoolValue(v *bool) bool
- func BoolValueMap(src map[string]*bool) map[string]bool
- func BoolValueSlice(src []*bool) []bool
- func Float64(v float64) *float64
- func Float64Map(src map[string]float64) map[string]*float64
- func Float64Slice(src []float64) []*float64
- func Float64Value(v *float64) float64
- func Float64ValueMap(src map[string]*float64) map[string]float64
- func Float64ValueSlice(src []*float64) []float64
- func Int(v int) *int
- func Int64(v int64) *int64
- func Int64Map(src map[string]int64) map[string]*int64
- func Int64Slice(src []int64) []*int64
- func Int64Value(v *int64) int64
- func Int64ValueMap(src map[string]*int64) map[string]int64
- func Int64ValueSlice(src []*int64) []int64
- func IntMap(src map[string]int) map[string]*int
- func IntSlice(src []int) []*int
- func IntValue(v *int) int
- func IntValueMap(src map[string]*int) map[string]int
- func IntValueSlice(src []*int) []int
- func String(v string) *string
- func StringMap(src map[string]string) map[string]*string
- func StringSlice(src []string) []*string
- func StringValue(v *string) string
- func StringValueMap(src map[string]*string) map[string]string
- func StringValueSlice(src []*string) []string
- func Time(v time.Time) *time.Time
- func TimeMap(src map[string]time.Time) map[string]*time.Time
- func TimeSlice(src []time.Time) []*time.Time
- func TimeValue(v *time.Time) time.Time
- func TimeValueMap(src map[string]*time.Time) map[string]time.Time
- func TimeValueSlice(src []*time.Time) []time.Time
- type Config
- func (c *Config) Copy(cfgs ...*Config) *Config
- func (c *Config) MergeIn(cfgs ...*Config)
- func (c *Config) WithCredentials(creds *credentials.Credentials) *Config
- func (c *Config) WithDisableComputeChecksums(disable bool) *Config
- func (c *Config) WithDisableParamValidation(disable bool) *Config
- func (c *Config) WithDisableSSL(disable bool) *Config
- func (c *Config) WithEndpoint(endpoint string) *Config
- func (c *Config) WithHTTPClient(client *http.Client) *Config
- func (c *Config) WithLogLevel(level LogLevelType) *Config
- func (c *Config) WithLogger(logger Logger) *Config
- func (c *Config) WithMaxRetries(max int) *Config
- func (c *Config) WithRegion(region string) *Config
- func (c *Config) WithS3ForcePathStyle(force bool) *Config
- func (c *Config) WithSleepDelay(fn func(time.Duration)) *Config
- type LogLevelType
- type Logger
- type ReaderSeekerCloser
- type RequestRetryer
- type WriteAtBuffer
Constants ¶
const SDKName = "aws-sdk-go"
SDKName is the name of this AWS SDK
const SDKVersion = "1.0.7"
SDKVersion is the version of this SDK
const UseServiceDefaultRetries = -1
UseServiceDefaultRetries instructs the config to use the service's own default number of retries. This will be the default action if Config.MaxRetries is nil also.
Variables ¶
var ( // ErrMissingRegion is an error that is returned if region configuration is // not found. // // @readonly ErrMissingRegion = awserr.New("MissingRegion", "could not find region configuration", nil) // ErrMissingEndpoint is an error that is returned if an endpoint cannot be // resolved for a service. // // @readonly ErrMissingEndpoint = awserr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil) )
Functions ¶
func BoolValue ¶
BoolValue returns the value of the bool pointer passed in or false if the pointer is nil.
func BoolValueMap ¶
BoolValueMap converts a string map of bool pointers into a string map of bool values
func BoolValueSlice ¶
BoolValueSlice converts a slice of bool pointers into a slice of bool values
func Float64Map ¶
Float64Map converts a string map of float64 values into a string map of float64 pointers
func Float64Slice ¶
Float64Slice converts a slice of float64 values into a slice of float64 pointers
func Float64Value ¶
Float64Value returns the value of the float64 pointer passed in or 0 if the pointer is nil.
func Float64ValueMap ¶
Float64ValueMap converts a string map of float64 pointers into a string map of float64 values
func Float64ValueSlice ¶
Float64ValueSlice converts a slice of float64 pointers into a slice of float64 values
func Int64Slice ¶
Int64Slice converts a slice of int64 values into a slice of int64 pointers
func Int64Value ¶
Int64Value returns the value of the int64 pointer passed in or 0 if the pointer is nil.
func Int64ValueMap ¶
Int64ValueMap converts a string map of int64 pointers into a string map of int64 values
func Int64ValueSlice ¶
Int64ValueSlice converts a slice of int64 pointers into a slice of int64 values
func IntValueMap ¶
IntValueMap converts a string map of int pointers into a string map of int values
func IntValueSlice ¶
IntValueSlice converts a slice of int pointers into a slice of int values
func StringMap ¶
StringMap converts a string map of string values into a string map of string pointers
func StringSlice ¶
StringSlice converts a slice of string values into a slice of string pointers
func StringValue ¶
StringValue returns the value of the string pointer passed in or "" if the pointer is nil.
func StringValueMap ¶
StringValueMap converts a string map of string pointers into a string map of string values
func StringValueSlice ¶
StringValueSlice converts a slice of string pointers into a slice of string values
func TimeMap ¶
TimeMap converts a string map of time.Time values into a string map of time.Time pointers
func TimeValue ¶
TimeValue returns the value of the time.Time pointer passed in or time.Time{} if the pointer is nil.
func TimeValueMap ¶
TimeValueMap converts a string map of time.Time pointers into a string map of time.Time values
Types ¶
type Config ¶
type Config struct { // The credentials object to use when signing requests. Defaults to // a chain of credential providers to search for credentials in environment // variables, shared credential file, and EC2 Instance Roles. Credentials *credentials.Credentials // An optional endpoint URL (hostname only or fully qualified URI) // that overrides the default generated endpoint for a client. Set this // to `""` to use the default generated endpoint. // // @note You must still provide a `Region` value when specifying an // endpoint for a client. Endpoint *string // The region to send requests to. This parameter is required and must // be configured globally or on a per-client basis unless otherwise // noted. A full list of regions is found in the "Regions and Endpoints" // document. // // @see http://docs.aws.amazon.com/general/latest/gr/rande.html // AWS Regions and Endpoints Region *string // Set this to `true` to disable SSL when sending requests. Defaults // to `false`. DisableSSL *bool // The HTTP client to use when sending requests. Defaults to // `http.DefaultClient`. HTTPClient *http.Client // An integer value representing the logging level. The default log level // is zero (LogOff), which represents no logging. To enable logging set // to a LogLevel Value. LogLevel *LogLevelType // The logger writer interface to write logging messages to. Defaults to // standard out. Logger Logger // The maximum number of times that a request will be retried for failures. // Defaults to -1, which defers the max retry setting to the service specific // configuration. MaxRetries *int // Retryer guides how HTTP requests should be retried in case of recoverable failures. // // When nil or the value does not implement the request.Retryer interface, // the request.DefaultRetryer will be used. // // When both Retryer and MaxRetries are non-nil, the former is used and // the latter ignored. // // To set the Retryer field in a type-safe manner and with chaining, use // the request.WithRetryer helper function: // // cfg := request.WithRetryer(aws.NewConfig(), myRetryer) // Retryer RequestRetryer // Disables semantic parameter validation, which validates input for missing // required fields and/or other semantic request input errors. DisableParamValidation *bool // Disables the computation of request and response checksums, e.g., // CRC32 checksums in Amazon DynamoDB. DisableComputeChecksums *bool // Set this to `true` to force the request to use path-style addressing, // i.e., `http://s3.amazonaws.com/BUCKET/KEY`. By default, the S3 client will // use virtual hosted bucket addressing when possible // (`http://BUCKET.s3.amazonaws.com/KEY`). // // @note This configuration option is specific to the Amazon S3 service. // @see http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html // Amazon S3: Virtual Hosting of Buckets S3ForcePathStyle *bool SleepDelay func(time.Duration) }
A Config provides service configuration for service clients. By default, all clients will use the {defaults.DefaultConfig} structure.
func NewConfig ¶
func NewConfig() *Config
NewConfig returns a new Config pointer that can be chained with builder methods to set multiple configuration values inline without using pointers.
svc := s3.New(aws.NewConfig().WithRegion("us-west-2").WithMaxRetries(10))
func (*Config) Copy ¶
Copy will return a shallow copy of the Config object. If any additional configurations are provided they will be merged into the new config returned.
func (*Config) WithCredentials ¶
func (c *Config) WithCredentials(creds *credentials.Credentials) *Config
WithCredentials sets a config Credentials value returning a Config pointer for chaining.
func (*Config) WithDisableComputeChecksums ¶
WithDisableComputeChecksums sets a config DisableComputeChecksums value returning a Config pointer for chaining.
func (*Config) WithDisableParamValidation ¶
WithDisableParamValidation sets a config DisableParamValidation value returning a Config pointer for chaining.
func (*Config) WithDisableSSL ¶
WithDisableSSL sets a config DisableSSL value returning a Config pointer for chaining.
func (*Config) WithEndpoint ¶
WithEndpoint sets a config Endpoint value returning a Config pointer for chaining.
func (*Config) WithHTTPClient ¶
WithHTTPClient sets a config HTTPClient value returning a Config pointer for chaining.
func (*Config) WithLogLevel ¶
func (c *Config) WithLogLevel(level LogLevelType) *Config
WithLogLevel sets a config LogLevel value returning a Config pointer for chaining.
func (*Config) WithLogger ¶
WithLogger sets a config Logger value returning a Config pointer for chaining.
func (*Config) WithMaxRetries ¶
WithMaxRetries sets a config MaxRetries value returning a Config pointer for chaining.
func (*Config) WithRegion ¶
WithRegion sets a config Region value returning a Config pointer for chaining.
func (*Config) WithS3ForcePathStyle ¶
WithS3ForcePathStyle sets a config S3ForcePathStyle value returning a Config pointer for chaining.
type LogLevelType ¶
type LogLevelType uint
A LogLevelType defines the level logging should be performed at. Used to instruct the SDK which statements should be logged.
const ( // LogOff states that no logging should be performed by the SDK. This is the // default state of the SDK, and should be use to disable all logging. LogOff LogLevelType = iota * 0x1000 // LogDebug state that debug output should be logged by the SDK. This should // be used to inspect request made and responses received. LogDebug )
const ( // LogDebugWithSigning states that the SDK should log request signing and // presigning events. This should be used to log the signing details of // requests for debugging. Will also enable LogDebug. LogDebugWithSigning LogLevelType = LogDebug | (1 << iota) // LogDebugWithHTTPBody states the SDK should log HTTP request and response // HTTP bodys in addition to the headers and path. This should be used to // see the body content of requests and responses made while using the SDK // Will also enable LogDebug. LogDebugWithHTTPBody // LogDebugWithRequestRetries states the SDK should log when service requests will // be retried. This should be used to log when you want to log when service // requests are being retried. Will also enable LogDebug. LogDebugWithRequestRetries // LogDebugWithRequestErrors states the SDK should log when service requests fail // to build, send, validate, or unmarshal. LogDebugWithRequestErrors )
Debug Logging Sub Levels
func LogLevel ¶
func LogLevel(l LogLevelType) *LogLevelType
LogLevel returns the pointer to a LogLevel. Should be used to workaround not being able to take the address of a non-composite literal.
func (*LogLevelType) AtLeast ¶
func (l *LogLevelType) AtLeast(v LogLevelType) bool
AtLeast returns true if this LogLevel is at least high enough to satisfies v. Is safe to use on nil value LogLevelTypes. If LogLevel is nill, will default to LogOff comparison.
func (*LogLevelType) Matches ¶
func (l *LogLevelType) Matches(v LogLevelType) bool
Matches returns true if the v LogLevel is enabled by this LogLevel. Should be used with logging sub levels. Is safe to use on nil value LogLevelTypes. If LogLevel is nill, will default to LogOff comparison.
func (*LogLevelType) Value ¶
func (l *LogLevelType) Value() LogLevelType
Value returns the LogLevel value or the default value LogOff if the LogLevel is nil. Safe to use on nil value LogLevelTypes.
type Logger ¶
type Logger interface {
Log(...interface{})
}
A Logger is a minimalistic interface for the SDK to log messages to. Should be used to provide custom logging writers for the SDK to use.
func NewDefaultLogger ¶
func NewDefaultLogger() Logger
NewDefaultLogger returns a Logger which will write log messages to stdout, and use same formatting runes as the stdlib log.Logger
type ReaderSeekerCloser ¶
type ReaderSeekerCloser struct {
// contains filtered or unexported fields
}
ReaderSeekerCloser represents a reader that can also delegate io.Seeker and io.Closer interfaces to the underlying object if they are available.
func ReadSeekCloser ¶
func ReadSeekCloser(r io.Reader) ReaderSeekerCloser
ReadSeekCloser wraps a io.Reader returning a ReaderSeekerCloser
func (ReaderSeekerCloser) Close ¶
func (r ReaderSeekerCloser) Close() error
Close closes the ReaderSeekerCloser.
If the ReaderSeekerCloser is not an io.Closer nothing will be done.
func (ReaderSeekerCloser) Read ¶
func (r ReaderSeekerCloser) Read(p []byte) (int, error)
Read reads from the reader up to size of p. The number of bytes read, and error if it occurred will be returned.
If the reader is not an io.Reader zero bytes read, and nil error will be returned.
Performs the same functionality as io.Reader Read
func (ReaderSeekerCloser) Seek ¶
func (r ReaderSeekerCloser) Seek(offset int64, whence int) (int64, error)
Seek sets the offset for the next Read to offset, interpreted according to whence: 0 means relative to the origin of the file, 1 means relative to the current offset, and 2 means relative to the end. Seek returns the new offset and an error, if any.
If the ReaderSeekerCloser is not an io.Seeker nothing will be done.
type RequestRetryer ¶
type RequestRetryer interface{}
RequestRetryer is an alias for a type that implements the request.Retryer interface.
type WriteAtBuffer ¶
type WriteAtBuffer struct {
// contains filtered or unexported fields
}
A WriteAtBuffer provides a in memory buffer supporting the io.WriterAt interface Can be used with the s3manager.Downloader to download content to a buffer in memory. Safe to use concurrently.
func (*WriteAtBuffer) Bytes ¶
func (b *WriteAtBuffer) Bytes() []byte
Bytes returns a slice of bytes written to the buffer.
func (*WriteAtBuffer) WriteAt ¶
func (b *WriteAtBuffer) WriteAt(p []byte, pos int64) (n int, err error)
WriteAt writes a slice of bytes to a buffer starting at the position provided The number of bytes written will be returned, or error. Can overwrite previous written slices if the write ats overlap.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package awserr represents API error interface accessors for the SDK.
|
Package awserr represents API error interface accessors for the SDK. |
Package credentials provides credential retrieval and management The Credentials is the primary method of getting access to and managing credentials Values.
|
Package credentials provides credential retrieval and management The Credentials is the primary method of getting access to and managing credentials Values. |
stscreds
Package stscreds are credential Providers to retrieve STS AWS credentials.
|
Package stscreds are credential Providers to retrieve STS AWS credentials. |
Package defaults is a collection of helpers to retrieve the SDK's default configuration and handlers.
|
Package defaults is a collection of helpers to retrieve the SDK's default configuration and handlers. |
Package ec2metadata provides the client for making API calls to the EC2 Metadata service.
|
Package ec2metadata provides the client for making API calls to the EC2 Metadata service. |
Package session provides a way to create service clients with shared configuration and handlers.
|
Package session provides a way to create service clients with shared configuration and handlers. |