aws - Amazon Web Services (original) (raw)
import "github.com/aws/aws-sdk-go/aws"
Overview ▹
Overview ▾
Package aws provides the core SDK's utilities and shared types. Use this package's utilities to simplify setting and reading API operations parameters.
Value and Pointer Conversion Utilities
This package includes a helper conversion utility for each scalar type the SDK's API use. These utilities make getting a pointer of the scalar, and dereferencing a pointer easier.
Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. The Pointer to value will safely dereference the pointer and return its value. If the pointer was nil, the scalar's zero value will be returned.
The value to pointer functions will be named after the scalar type. So get a *string from a string value use the "String" function. This makes it easy to to get pointer of a literal string value, because getting the address of a literal requires assigning the value to a variable first.
var strPtr *string
// Without the SDK's conversion functions str := "my string" strPtr = &str
// With the SDK's conversion functions strPtr = aws.String("my string")
// Convert *string to string value str = aws.StringValue(strPtr)
In addition to scalars the aws package also includes conversion utilities for map and slice for commonly types used in API parameters. The map and slice conversion functions use similar naming pattern as the scalar conversion functions.
var strPtrs []*string var strs []string = []string{"Go", "Gophers", "Go"}
// Convert []string to []*string strPtrs = aws.StringSlice(strs)
// Convert []*string to []string strs = aws.StringValueSlice(strPtrs)
SDK Default HTTP Client
The SDK will use the http.DefaultClient if a HTTP client is not provided to the SDK's Session, or service client constructor. This means that if the http.DefaultClient is modified by other components of your application the modifications will be picked up by the SDK as well.
In some cases this might be intended, but it is a better practice to create a custom HTTP Client to share explicitly through your application. You can configure the SDK to use the custom HTTP Client by setting the HTTPClient value of the SDK's Config type when creating a Session or service client.
Package aws provides core functionality for making requests to AWS services.
Index ▹
Index ▾
func BoolMap(src map[string]bool) map[string]*bool
func BoolSlice(src []bool) []*bool
func BoolValueMap(src map[string]*bool) map[string]bool
func BoolValueSlice(src []*bool) []bool
func CopySeekableBody(dst io.Writer, src io.ReadSeeker) (int64, error)
func Float32(v float32) *float32
func Float32Map(src map[string]float32) map[string]*float32
func Float32Slice(src []float32) []*float32
func Float32Value(v *float32) float32
func Float32ValueMap(src map[string]*float32) map[string]float32
func Float32ValueSlice(src []*float32) []float32
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 Int16Map(src map[string]int16) map[string]*int16
func Int16Slice(src []int16) []*int16
func Int16Value(v *int16) int16
func Int16ValueMap(src map[string]*int16) map[string]int16
func Int16ValueSlice(src []*int16) []int16
func Int32Map(src map[string]int32) map[string]*int32
func Int32Slice(src []int32) []*int32
func Int32Value(v *int32) int32
func Int32ValueMap(src map[string]*int32) map[string]int32
func Int32ValueSlice(src []*int32) []int32
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 Int8Map(src map[string]int8) map[string]*int8
func Int8Slice(src []int8) []*int8
func Int8ValueMap(src map[string]*int8) map[string]int8
func Int8ValueSlice(src []*int8) []int8
func IntMap(src map[string]int) map[string]*int
func IntSlice(src []int) []*int
func IntValueMap(src map[string]*int) map[string]int
func IntValueSlice(src []*int) []int
func IsReaderSeekable(r io.Reader) bool
func MillisecondsTimeValue(v *int64) time.Time
func SecondsTimeValue(v *int64) time.Time
func SeekerLen(s io.Seeker) (int64, error)
func SleepWithContext(ctx Context, dur time.Duration) error
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 TimeUnixMilli(t time.Time) int64
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
func URLHostname(url *url.URL) string
func Uint16Map(src map[string]uint16) map[string]*uint16
func Uint16Slice(src []uint16) []*uint16
func Uint16Value(v *uint16) uint16
func Uint16ValueMap(src map[string]*uint16) map[string]uint16
func Uint16ValueSlice(src []*uint16) []uint16
func Uint32Map(src map[string]uint32) map[string]*uint32
func Uint32Slice(src []uint32) []*uint32
func Uint32Value(v *uint32) uint32
func Uint32ValueMap(src map[string]*uint32) map[string]uint32
func Uint32ValueSlice(src []*uint32) []uint32
func Uint64Map(src map[string]uint64) map[string]*uint64
func Uint64Slice(src []uint64) []*uint64
func Uint64Value(v *uint64) uint64
func Uint64ValueMap(src map[string]*uint64) map[string]uint64
func Uint64ValueSlice(src []*uint64) []uint64
func Uint8Map(src map[string]uint8) map[string]*uint8
func Uint8Slice(src []uint8) []*uint8
func Uint8Value(v *uint8) uint8
func Uint8ValueMap(src map[string]*uint8) map[string]uint8
func Uint8ValueSlice(src []*uint8) []uint8
func UintMap(src map[string]uint) map[string]*uint
func UintSlice(src []uint) []*uint
func UintValueMap(src map[string]*uint) map[string]uint
func UintValueSlice(src []*uint) []uint
func (c *Config) Copy(cfgs ...*Config) *Config
func (c *Config) MergeIn(cfgs ...*Config)
func (c *Config) WithCredentials(creds *credentials.Credentials) *Config
func (c *Config) WithCredentialsChainVerboseErrors(verboseErrs bool) *Config
func (c *Config) WithDisableComputeChecksums(disable bool) *Config
func (c *Config) WithDisableEndpointHostPrefix(t bool) *Config
func (c *Config) WithDisableParamValidation(disable bool) *Config
func (c *Config) WithDisableRestProtocolURICleaning(t bool) *Config
func (c *Config) WithDisableSSL(disable bool) *Config
func (c *Config) WithEC2MetadataDisableTimeoutOverride(enable bool) *Config
func (c *Config) WithEC2MetadataEnableFallback(v bool) *Config
func (c *Config) WithEndpoint(endpoint string) *Config
func (c *Config) WithEndpointDiscovery(t bool) *Config
func (c *Config) WithEndpointResolver(resolver endpoints.Resolver) *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) WithLowerCaseHeaderMaps(t bool) *Config
func (c *Config) WithMaxRetries(max int) *Config
func (c *Config) WithRegion(region string) *Config
func (c *Config) WithS3Disable100Continue(disable bool) *Config
func (c *Config) WithS3DisableContentMD5Validation(enable bool) *Config
func (c *Config) WithS3ForcePathStyle(force bool) *Config
func (c *Config) WithS3UsEast1RegionalEndpoint(sre endpoints.S3UsEast1RegionalEndpoint) *Config
func (c *Config) WithS3UseARNRegion(enable bool) *Config
func (c *Config) WithS3UseAccelerate(enable bool) *Config
func (c *Config) WithSTSRegionalEndpoint(sre endpoints.STSRegionalEndpoint) *Config
func (c *Config) WithSleepDelay(fn func(time.Duration)) *Config
func (c *Config) WithUseDualStack(enable bool) *Config
func (c *Config) WithUseFIPSEndpoint(enable bool) *Config
func BackgroundContext() Context
func LogLevel(l LogLevelType) *LogLevelType
func (l *LogLevelType) AtLeast(v LogLevelType) bool
func (l *LogLevelType) Matches(v LogLevelType) bool
func (l *LogLevelType) Value() LogLevelType
func NewDefaultLogger() Logger
func (f LoggerFunc) Log(args ...interface{})
func (m MultiCloser) Close() error
func ReadSeekCloser(r io.Reader) ReaderSeekerCloser
func (r ReaderSeekerCloser) Close() error
func (r ReaderSeekerCloser) GetLen() (int64, error)
func (r ReaderSeekerCloser) HasLen() (int, bool)
func (r ReaderSeekerCloser) IsSeeker() bool
func (r ReaderSeekerCloser) Read(p []byte) (int, error)
func (r ReaderSeekerCloser) Seek(offset int64, whence int) (int64, error)
func NewWriteAtBuffer(buf []byte) *WriteAtBuffer
func (b *WriteAtBuffer) Bytes() []byte
func (b *WriteAtBuffer) WriteAt(p []byte, pos int64) (n int, err error)
Package files
config.go context_1_9.go context_background_1_7.go context_sleep.go convert_types.go doc.go errors.go jsonvalue.go logger.go types.go url.go version.go
Internal call graph ▹
Internal call graph ▾
In the call graph viewer below, each node is a function belonging to this package and its children are the functions it calls—perhaps dynamically.
The root nodes are the entry points of the package: functions that may be called from outside the package. There may be non-exported or anonymous functions among them if they are called dynamically from another package.
Click a node to visit that function's source code. From there you can visit its callers by clicking its declaring func
token.
Functions may be omitted if they were determined to be unreachable in the particular programs or tests that were analyzed.
Constants ¶
const SDKName = "aws-sdk-go"
SDKName is the name of this AWS SDK
const SDKVersion = "1.55.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 = [awserr](/sdk-for-go/api/aws/awserr/).[New](/sdk-for-go/api/aws/awserr/#New)("MissingRegion", "could not find region configuration", nil)
ErrMissingEndpoint = awserr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil)
)
func Bool ¶
func Bool(v bool) *bool
Bool returns a pointer to the bool value passed in.
func BoolMap ¶
func BoolMap(src map[string]bool) map[string]*bool
BoolMap converts a string map of bool values into a string map of bool pointers
func BoolSlice ¶
func BoolSlice(src []bool) []*bool
BoolSlice converts a slice of bool values into a slice of bool pointers
func BoolValue ¶
func BoolValue(v *bool) bool
BoolValue returns the value of the bool pointer passed in or false if the pointer is nil.
func BoolValueMap ¶
func BoolValueMap(src map[string]*bool) map[string]bool
BoolValueMap converts a string map of bool pointers into a string map of bool values
func BoolValueSlice ¶
func BoolValueSlice(src []*bool) []bool
BoolValueSlice converts a slice of bool pointers into a slice of bool values
func CopySeekableBody ¶
func CopySeekableBody(dst io.Writer, src io.ReadSeeker) (int64, error)
CopySeekableBody copies the seekable body to an io.Writer
func Float32 ¶
func Float32(v float32) *float32
Float32 returns a pointer to the float32 value passed in.
func Float32Map ¶
func Float32Map(src map[string]float32) map[string]*float32
Float32Map converts a string map of float32 values into a string map of float32 pointers
func Float32Slice ¶
func Float32Slice(src []float32) []*float32
Float32Slice converts a slice of float32 values into a slice of float32 pointers
func Float32Value ¶
func Float32Value(v *float32) float32
Float32Value returns the value of the float32 pointer passed in or 0 if the pointer is nil.
func Float32ValueMap ¶
func Float32ValueMap(src map[string]*float32) map[string]float32
Float32ValueMap converts a string map of float32 pointers into a string map of float32 values
func Float32ValueSlice ¶
func Float32ValueSlice(src []*float32) []float32
Float32ValueSlice converts a slice of float32 pointers into a slice of float32 values
func Float64 ¶
func Float64(v float64) *float64
Float64 returns a pointer to the float64 value passed in.
func Float64Map ¶
func Float64Map(src map[string]float64) map[string]*float64
Float64Map converts a string map of float64 values into a string map of float64 pointers
func Float64Slice ¶
func Float64Slice(src []float64) []*float64
Float64Slice converts a slice of float64 values into a slice of float64 pointers
func Float64Value ¶
func Float64Value(v *float64) float64
Float64Value returns the value of the float64 pointer passed in or 0 if the pointer is nil.
func Float64ValueMap ¶
func Float64ValueMap(src map[string]*float64) map[string]float64
Float64ValueMap converts a string map of float64 pointers into a string map of float64 values
func Float64ValueSlice ¶
func Float64ValueSlice(src []*float64) []float64
Float64ValueSlice converts a slice of float64 pointers into a slice of float64 values
func Int ¶
func Int(v int) *int
Int returns a pointer to the int value passed in.
func Int16 ¶
func Int16(v int16) *int16
Int16 returns a pointer to the int16 value passed in.
func Int16Map ¶
func Int16Map(src map[string]int16) map[string]*int16
Int16Map converts a string map of int16 values into a string map of int16 pointers
func Int16Slice ¶
func Int16Slice(src []int16) []*int16
Int16Slice converts a slice of int16 values into a slice of int16 pointers
func Int16Value ¶
func Int16Value(v *int16) int16
Int16Value returns the value of the int16 pointer passed in or 0 if the pointer is nil.
func Int16ValueMap ¶
func Int16ValueMap(src map[string]*int16) map[string]int16
Int16ValueMap converts a string map of int16 pointers into a string map of int16 values
func Int16ValueSlice ¶
func Int16ValueSlice(src []*int16) []int16
Int16ValueSlice converts a slice of int16 pointers into a slice of int16 values
func Int32 ¶
func Int32(v int32) *int32
Int32 returns a pointer to the int32 value passed in.
func Int32Map ¶
func Int32Map(src map[string]int32) map[string]*int32
Int32Map converts a string map of int32 values into a string map of int32 pointers
func Int32Slice ¶
func Int32Slice(src []int32) []*int32
Int32Slice converts a slice of int32 values into a slice of int32 pointers
func Int32Value ¶
func Int32Value(v *int32) int32
Int32Value returns the value of the int32 pointer passed in or 0 if the pointer is nil.
func Int32ValueMap ¶
func Int32ValueMap(src map[string]*int32) map[string]int32
Int32ValueMap converts a string map of int32 pointers into a string map of int32 values
func Int32ValueSlice ¶
func Int32ValueSlice(src []*int32) []int32
Int32ValueSlice converts a slice of int32 pointers into a slice of int32 values
func Int64 ¶
func Int64(v int64) *int64
Int64 returns a pointer to the int64 value passed in.
func Int64Map ¶
func Int64Map(src map[string]int64) map[string]*int64
Int64Map converts a string map of int64 values into a string map of int64 pointers
func Int64Slice ¶
func Int64Slice(src []int64) []*int64
Int64Slice converts a slice of int64 values into a slice of int64 pointers
func Int64Value ¶
func Int64Value(v *int64) int64
Int64Value returns the value of the int64 pointer passed in or 0 if the pointer is nil.
func Int64ValueMap ¶
func Int64ValueMap(src map[string]*int64) map[string]int64
Int64ValueMap converts a string map of int64 pointers into a string map of int64 values
func Int64ValueSlice ¶
func Int64ValueSlice(src []*int64) []int64
Int64ValueSlice converts a slice of int64 pointers into a slice of int64 values
func Int8 ¶
func Int8(v int8) *int8
Int8 returns a pointer to the int8 value passed in.
func Int8Map ¶
func Int8Map(src map[string]int8) map[string]*int8
Int8Map converts a string map of int8 values into a string map of int8 pointers
func Int8Slice ¶
func Int8Slice(src []int8) []*int8
Int8Slice converts a slice of int8 values into a slice of int8 pointers
func Int8Value ¶
func Int8Value(v *int8) int8
Int8Value returns the value of the int8 pointer passed in or 0 if the pointer is nil.
func Int8ValueMap ¶
func Int8ValueMap(src map[string]*int8) map[string]int8
Int8ValueMap converts a string map of int8 pointers into a string map of int8 values
func Int8ValueSlice ¶
func Int8ValueSlice(src []*int8) []int8
Int8ValueSlice converts a slice of int8 pointers into a slice of int8 values
func IntMap ¶
func IntMap(src map[string]int) map[string]*int
IntMap converts a string map of int values into a string map of int pointers
func IntSlice ¶
func IntSlice(src []int) []*int
IntSlice converts a slice of int values into a slice of int pointers
func IntValue ¶
func IntValue(v *int) int
IntValue returns the value of the int pointer passed in or 0 if the pointer is nil.
func IntValueMap ¶
func IntValueMap(src map[string]*int) map[string]int
IntValueMap converts a string map of int pointers into a string map of int values
func IntValueSlice ¶
func IntValueSlice(src []*int) []int
IntValueSlice converts a slice of int pointers into a slice of int values
func IsReaderSeekable ¶
func IsReaderSeekable(r io.Reader) bool
IsReaderSeekable returns if the underlying reader type can be seeked. A io.Reader might not actually be seekable if it is the ReaderSeekerCloser type.
func MillisecondsTimeValue ¶
func MillisecondsTimeValue(v *int64) time.Time
MillisecondsTimeValue converts an int64 pointer to a time.Time value representing milliseconds sinch Epoch or time.Time{} if the pointer is nil.
func SecondsTimeValue ¶
func SecondsTimeValue(v *int64) time.Time
SecondsTimeValue converts an int64 pointer to a time.Time value representing seconds since Epoch or time.Time{} if the pointer is nil.
func SeekerLen ¶
func SeekerLen(s io.Seeker) (int64, error)
SeekerLen attempts to get the number of bytes remaining at the seeker's current position. Returns the number of bytes remaining or error.
func SleepWithContext ¶
func SleepWithContext(ctx Context, dur time.Duration) error
SleepWithContext will wait for the timer duration to expire, or the context is canceled. Which ever happens first. If the context is canceled the Context's error will be returned.
Expects Context to always return a non-nil error if the Done channel is closed.
func String ¶
func String(v string) *string
String returns a pointer to the string value passed in.
func StringMap ¶
func StringMap(src map[string]string) map[string]*string
StringMap converts a string map of string values into a string map of string pointers
func StringSlice ¶
func StringSlice(src []string) []*string
StringSlice converts a slice of string values into a slice of string pointers
func StringValue ¶
func StringValue(v *string) string
StringValue returns the value of the string pointer passed in or "" if the pointer is nil.
func StringValueMap ¶
func StringValueMap(src map[string]*string) map[string]string
StringValueMap converts a string map of string pointers into a string map of string values
func StringValueSlice ¶
func StringValueSlice(src []*string) []string
StringValueSlice converts a slice of string pointers into a slice of string values
func Time ¶
func Time(v time.Time) *time.Time
Time returns a pointer to the time.Time value passed in.
func TimeMap ¶
func TimeMap(src map[string]time.Time) map[string]*time.Time
TimeMap converts a string map of time.Time values into a string map of time.Time pointers
func TimeSlice ¶
func TimeSlice(src []time.Time) []*time.Time
TimeSlice converts a slice of time.Time values into a slice of time.Time pointers
func TimeUnixMilli ¶
func TimeUnixMilli(t time.Time) int64
TimeUnixMilli returns a Unix timestamp in milliseconds from "January 1, 1970 UTC". The result is undefined if the Unix time cannot be represented by an int64. Which includes calling TimeUnixMilli on a zero Time is undefined.
This utility is useful for service API's such as CloudWatch Logs which require their unix time values to be in milliseconds.
See Go stdlib https://golang.org/pkg/time/#Time.UnixNano for more information.
func TimeValue ¶
func TimeValue(v *time.Time) time.Time
TimeValue returns the value of the time.Time pointer passed in or time.Time{} if the pointer is nil.
func TimeValueMap ¶
func TimeValueMap(src map[string]*time.Time) map[string]time.Time
TimeValueMap converts a string map of time.Time pointers into a string map of time.Time values
func TimeValueSlice ¶
func TimeValueSlice(src []*time.Time) []time.Time
TimeValueSlice converts a slice of time.Time pointers into a slice of time.Time values
func URLHostname ¶
func URLHostname(url *url.URL) string
URLHostname will extract the Hostname without port from the URL value.
Wrapper of net/url#URL.Hostname for backwards Go version compatibility.
func Uint ¶
func Uint(v uint) *uint
Uint returns a pointer to the uint value passed in.
func Uint16 ¶
func Uint16(v uint16) *uint16
Uint16 returns a pointer to the uint16 value passed in.
func Uint16Map ¶
func Uint16Map(src map[string]uint16) map[string]*uint16
Uint16Map converts a string map of uint16 values into a string map of uint16 pointers
func Uint16Slice ¶
func Uint16Slice(src []uint16) []*uint16
Uint16Slice converts a slice of uint16 values into a slice of uint16 pointers
func Uint16Value ¶
func Uint16Value(v *uint16) uint16
Uint16Value returns the value of the uint16 pointer passed in or 0 if the pointer is nil.
func Uint16ValueMap ¶
func Uint16ValueMap(src map[string]*uint16) map[string]uint16
Uint16ValueMap converts a string map of uint16 pointers into a string map of uint16 values
func Uint16ValueSlice ¶
func Uint16ValueSlice(src []*uint16) []uint16
Uint16ValueSlice converts a slice of uint16 pointers into a slice of uint16 values
func Uint32 ¶
func Uint32(v uint32) *uint32
Uint32 returns a pointer to the uint32 value passed in.
func Uint32Map ¶
func Uint32Map(src map[string]uint32) map[string]*uint32
Uint32Map converts a string map of uint32 values into a string map of uint32 pointers
func Uint32Slice ¶
func Uint32Slice(src []uint32) []*uint32
Uint32Slice converts a slice of uint32 values into a slice of uint32 pointers
func Uint32Value ¶
func Uint32Value(v *uint32) uint32
Uint32Value returns the value of the uint32 pointer passed in or 0 if the pointer is nil.
func Uint32ValueMap ¶
func Uint32ValueMap(src map[string]*uint32) map[string]uint32
Uint32ValueMap converts a string map of uint32 pointers into a string map of uint32 values
func Uint32ValueSlice ¶
func Uint32ValueSlice(src []*uint32) []uint32
Uint32ValueSlice converts a slice of uint32 pointers into a slice of uint32 values
func Uint64 ¶
func Uint64(v uint64) *uint64
Uint64 returns a pointer to the uint64 value passed in.
func Uint64Map ¶
func Uint64Map(src map[string]uint64) map[string]*uint64
Uint64Map converts a string map of uint64 values into a string map of uint64 pointers
func Uint64Slice ¶
func Uint64Slice(src []uint64) []*uint64
Uint64Slice converts a slice of uint64 values into a slice of uint64 pointers
func Uint64Value ¶
func Uint64Value(v *uint64) uint64
Uint64Value returns the value of the uint64 pointer passed in or 0 if the pointer is nil.
func Uint64ValueMap ¶
func Uint64ValueMap(src map[string]*uint64) map[string]uint64
Uint64ValueMap converts a string map of uint64 pointers into a string map of uint64 values
func Uint64ValueSlice ¶
func Uint64ValueSlice(src []*uint64) []uint64
Uint64ValueSlice converts a slice of uint64 pointers into a slice of uint64 values
func Uint8 ¶
func Uint8(v uint8) *uint8
Uint8 returns a pointer to the uint8 value passed in.
func Uint8Map ¶
func Uint8Map(src map[string]uint8) map[string]*uint8
Uint8Map converts a string map of uint8 values into a string map of uint8 pointers
func Uint8Slice ¶
func Uint8Slice(src []uint8) []*uint8
Uint8Slice converts a slice of uint8 values into a slice of uint8 pointers
func Uint8Value ¶
func Uint8Value(v *uint8) uint8
Uint8Value returns the value of the uint8 pointer passed in or 0 if the pointer is nil.
func Uint8ValueMap ¶
func Uint8ValueMap(src map[string]*uint8) map[string]uint8
Uint8ValueMap converts a string map of uint8 pointers into a string map of uint8 values
func Uint8ValueSlice ¶
func Uint8ValueSlice(src []*uint8) []uint8
Uint8ValueSlice converts a slice of uint8 pointers into a slice of uint8 values
func UintMap ¶
func UintMap(src map[string]uint) map[string]*uint
UintMap converts a string map of uint values uinto a string map of uint pointers
func UintSlice ¶
func UintSlice(src []uint) []*uint
UintSlice converts a slice of uint values uinto a slice of uint pointers
func UintValue ¶
func UintValue(v *uint) uint
UintValue returns the value of the uint pointer passed in or 0 if the pointer is nil.
func UintValueMap ¶
func UintValueMap(src map[string]*uint) map[string]uint
UintValueMap converts a string map of uint pointers uinto a string map of uint values
func UintValueSlice ¶
func UintValueSlice(src []*uint) []uint
UintValueSlice converts a slice of uint pointers uinto a slice of uint values
type Config ¶
type Config struct {
CredentialsChainVerboseErrors *bool
Credentials *credentials.Credentials
Endpoint *string
EndpointResolver endpoints.Resolver
EnforceShouldRetryCheck *bool
Region *string
DisableSSL *bool
HTTPClient *http.Client
LogLevel *LogLevelType
Logger Logger
MaxRetries *int
Retryer RequestRetryer
DisableParamValidation *bool
DisableComputeChecksums *bool
S3ForcePathStyle *bool
S3Disable100Continue *bool
S3UseAccelerate *bool
S3DisableContentMD5Validation *bool
S3UseARNRegion *bool
LowerCaseHeaderMaps *bool
EC2MetadataDisableTimeoutOverride *bool
EC2MetadataEnableFallback *bool
UseDualStack *bool
UseDualStackEndpoint endpoints.DualStackEndpointState
UseFIPSEndpoint endpoints.FIPSEndpointState
SleepDelay func(time.Duration)
DisableRestProtocolURICleaning *bool
EnableEndpointDiscovery *bool
DisableEndpointHostPrefix *bool
STSRegionalEndpoint endpoints.STSRegionalEndpoint
S3UsEast1RegionalEndpoint endpoints.S3UsEast1RegionalEndpoint
}
A Config provides service configuration for service clients. By default, all clients will use the defaults.DefaultConfig structure.
// Create Session with MaxRetries configuration to be shared by multiple // service clients. sess := session.Must(session.NewSession(&aws.Config{ MaxRetries: aws.Int(3), }))
// Create S3 service client with a specific Region. svc := s3.New(sess, &aws.Config{ Region: aws.String("us-west-2"), })
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.
// Create Session with MaxRetries configuration to be shared by multiple // service clients. sess := session.Must(session.NewSession(aws.NewConfig(). WithMaxRetries(3), ))
// Create S3 service client with a specific Region. svc := s3.New(sess, aws.NewConfig(). WithRegion("us-west-2"), )
func (*Config) Copy ¶
func (c Config) Copy(cfgs ...Config) *Config
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) MergeIn ¶
func (c Config) MergeIn(cfgs ...Config)
MergeIn merges the passed in configs into the existing config object.
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) WithCredentialsChainVerboseErrors ¶
func (c *Config) WithCredentialsChainVerboseErrors(verboseErrs bool) *Config
WithCredentialsChainVerboseErrors sets a config verbose errors boolean and returning a Config pointer.
func (*Config) WithDisableComputeChecksums ¶
func (c *Config) WithDisableComputeChecksums(disable bool) *Config
WithDisableComputeChecksums sets a config DisableComputeChecksums value returning a Config pointer for chaining.
func (*Config) WithDisableEndpointHostPrefix ¶
func (c *Config) WithDisableEndpointHostPrefix(t bool) *Config
WithDisableEndpointHostPrefix will set whether or not to use modeled host prefix when making requests.
func (*Config) WithDisableParamValidation ¶
func (c *Config) WithDisableParamValidation(disable bool) *Config
WithDisableParamValidation sets a config DisableParamValidation value returning a Config pointer for chaining.
func (*Config) WithDisableRestProtocolURICleaning ¶
func (c *Config) WithDisableRestProtocolURICleaning(t bool) *Config
WithDisableRestProtocolURICleaning sets a config DisableRestProtocolURICleaning value returning a Config pointer for chaining.
func (*Config) WithDisableSSL ¶
func (c *Config) WithDisableSSL(disable bool) *Config
WithDisableSSL sets a config DisableSSL value returning a Config pointer for chaining.
func (*Config) WithEC2MetadataDisableTimeoutOverride ¶
func (c *Config) WithEC2MetadataDisableTimeoutOverride(enable bool) *Config
WithEC2MetadataDisableTimeoutOverride sets a config EC2MetadataDisableTimeoutOverride value returning a Config pointer for chaining.
func (*Config) WithEC2MetadataEnableFallback ¶
func (c *Config) WithEC2MetadataEnableFallback(v bool) *Config
WithEC2MetadataEnableFallback sets a config EC2MetadataEnableFallback value returning a Config pointer for chaining.
func (*Config) WithEndpoint ¶
func (c *Config) WithEndpoint(endpoint string) *Config
WithEndpoint sets a config Endpoint value returning a Config pointer for chaining.
func (*Config) WithEndpointDiscovery ¶
func (c *Config) WithEndpointDiscovery(t bool) *Config
WithEndpointDiscovery will set whether or not to use endpoint discovery.
func (*Config) WithEndpointResolver ¶
func (c *Config) WithEndpointResolver(resolver endpoints.Resolver) *Config
WithEndpointResolver sets a config EndpointResolver value returning a Config pointer for chaining.
func (*Config) WithHTTPClient ¶
func (c *Config) WithHTTPClient(client *http.Client) *Config
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 ¶
func (c *Config) WithLogger(logger Logger) *Config
WithLogger sets a config Logger value returning a Config pointer for chaining.
func (c *Config) WithLowerCaseHeaderMaps(t bool) *Config
WithLowerCaseHeaderMaps sets a config LowerCaseHeaderMaps value returning a Config pointer for chaining.
func (*Config) WithMaxRetries ¶
func (c *Config) WithMaxRetries(max int) *Config
WithMaxRetries sets a config MaxRetries value returning a Config pointer for chaining.
func (*Config) WithRegion ¶
func (c *Config) WithRegion(region string) *Config
WithRegion sets a config Region value returning a Config pointer for chaining.
func (*Config) WithS3Disable100Continue ¶
func (c *Config) WithS3Disable100Continue(disable bool) *Config
WithS3Disable100Continue sets a config S3Disable100Continue value returning a Config pointer for chaining.
func (*Config) WithS3DisableContentMD5Validation ¶
func (c *Config) WithS3DisableContentMD5Validation(enable bool) *Config
WithS3DisableContentMD5Validation sets a config S3DisableContentMD5Validation value returning a Config pointer for chaining.
func (*Config) WithS3ForcePathStyle ¶
func (c *Config) WithS3ForcePathStyle(force bool) *Config
WithS3ForcePathStyle sets a config S3ForcePathStyle value returning a Config pointer for chaining.
func (*Config) WithS3UsEast1RegionalEndpoint ¶
func (c *Config) WithS3UsEast1RegionalEndpoint(sre endpoints.S3UsEast1RegionalEndpoint) *Config
WithS3UsEast1RegionalEndpoint will set whether or not to use regional endpoint flag when resolving the endpoint for a service
func (*Config) WithS3UseARNRegion ¶
func (c *Config) WithS3UseARNRegion(enable bool) *Config
WithS3UseARNRegion sets a config S3UseARNRegion value and returning a Config pointer for chaining
func (*Config) WithS3UseAccelerate ¶
func (c *Config) WithS3UseAccelerate(enable bool) *Config
WithS3UseAccelerate sets a config S3UseAccelerate value returning a Config pointer for chaining.
func (*Config) WithSTSRegionalEndpoint ¶
func (c *Config) WithSTSRegionalEndpoint(sre endpoints.STSRegionalEndpoint) *Config
WithSTSRegionalEndpoint will set whether or not to use regional endpoint flag when resolving the endpoint for a service
func (*Config) WithSleepDelay ¶
func (c *Config) WithSleepDelay(fn func(time.Duration)) *Config
WithSleepDelay overrides the function used to sleep while waiting for the next retry. Defaults to time.Sleep.
func (*Config) WithUseDualStack ¶
func (c *Config) WithUseDualStack(enable bool) *Config
WithUseDualStack sets a config UseDualStack value returning a Config pointer for chaining.
func (*Config) WithUseFIPSEndpoint ¶
func (c *Config) WithUseFIPSEndpoint(enable bool) *Config
WithUseFIPSEndpoint sets a config UseFIPSEndpoint value returning a Config pointer for chaining.
type Context ¶
type Context = context.Context
Context is an alias of the Go stdlib's context.Context interface. It can be used within the SDK's API operation "WithContext" methods.
See https://golang.org/pkg/context on how to use contexts.
func BackgroundContext ¶
func BackgroundContext() Context
BackgroundContext returns a context that will never be canceled, has no values, and no deadline. This context is used by the SDK to provide backwards compatibility with non-context API operations and functionality.
Go 1.6 and before: This context function is equivalent to context.Background in the Go stdlib.
Go 1.7 and later: The context returned will be the value returned by context.Background()
See https://golang.org/pkg/context for more information on Contexts.
type JSONValue ¶
type JSONValue map[string]interface{}
JSONValue is a representation of a grab bag type that will be marshaled into a json string. This type can be used just like any other map.
Example:
values := aws.JSONValue{ "Foo": "Bar", } values["Baz"] = "Qux"
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 [LogLevelType](#LogLevelType) = iota * 0x1000
LogDebug
)
const (
LogDebugWithSigning [LogLevelType](#LogLevelType) = [LogDebug](#LogDebug) | (1 << iota)
LogDebugWithHTTPBody
LogDebugWithRequestRetries
LogDebugWithRequestErrors
LogDebugWithEventStreamBody
LogDebugWithDeprecated
)
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 nil, 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 nil, 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 LoggerFunc ¶
type LoggerFunc func(...interface{})
A LoggerFunc is a convenience type to convert a function taking a variadic list of arguments and wrap it so the Logger interface can be used.
Example:
s3.New(sess, &aws.Config{Logger: aws.LoggerFunc(func(args ...interface{}) { fmt.Fprintln(os.Stdout, args...) })})
func (LoggerFunc) Log ¶
func (f LoggerFunc) Log(args ...interface{})
Log calls the wrapped function with the arguments provided
type MultiCloser ¶
type MultiCloser []io.Closer
MultiCloser is a utility to close multiple io.Closers within a single statement.
func (MultiCloser) Close ¶
func (m MultiCloser) Close() error
Close closes all of the io.Closers making up the MultiClosers. Any errors that occur while closing will be returned in the order they occur.
type ReaderSeekerCloser ¶
type ReaderSeekerCloser struct {
}
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. Allows the SDK to accept an io.Reader that is not also an io.Seeker for unsigned streaming payload API operations.
A ReadSeekCloser wrapping an nonseekable io.Reader used in an API operation's input will prevent that operation being retried in the case of network errors, and cause operation requests to fail if the operation requires payload signing.
Note: If using With S3 PutObject to stream an object upload The SDK's S3 Upload manager (s3manager.Uploader) provides support for streaming with the ability to retry network errors.
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) GetLen ¶
func (r ReaderSeekerCloser) GetLen() (int64, error)
GetLen returns the length of the bytes remaining in the underlying reader. Checks first for Len(), then io.Seeker to determine the size of the underlying reader.
Will return -1 if the length cannot be determined.
func (ReaderSeekerCloser) HasLen ¶
func (r ReaderSeekerCloser) HasLen() (int, bool)
HasLen returns the length of the underlying reader if the value implements the Len() int method.
func (ReaderSeekerCloser) IsSeeker ¶
func (r ReaderSeekerCloser) IsSeeker() bool
IsSeeker returns if the underlying reader is also a seeker.
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 {
GrowthCoeff float64
}
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 NewWriteAtBuffer ¶
func NewWriteAtBuffer(buf []byte) *WriteAtBuffer
NewWriteAtBuffer creates a WriteAtBuffer with an internal buffer provided by buf.
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.