Blame vendor/github.com/aws/aws-sdk-go/aws/doc.go

Packit 63bb0d
// Package aws provides the core SDK's utilities and shared types. Use this package's
Packit 63bb0d
// utilities to simplify setting and reading API operations parameters.
Packit 63bb0d
//
Packit 63bb0d
// Value and Pointer Conversion Utilities
Packit 63bb0d
//
Packit 63bb0d
// This package includes a helper conversion utility for each scalar type the SDK's
Packit 63bb0d
// API use. These utilities make getting a pointer of the scalar, and dereferencing
Packit 63bb0d
// a pointer easier.
Packit 63bb0d
//
Packit 63bb0d
// Each conversion utility comes in two forms. Value to Pointer and Pointer to Value.
Packit 63bb0d
// The Pointer to value will safely dereference the pointer and return its value.
Packit 63bb0d
// If the pointer was nil, the scalar's zero value will be returned.
Packit 63bb0d
//
Packit 63bb0d
// The value to pointer functions will be named after the scalar type. So get a
Packit 63bb0d
// *string from a string value use the "String" function. This makes it easy to
Packit 63bb0d
// to get pointer of a literal string value, because getting the address of a
Packit 63bb0d
// literal requires assigning the value to a variable first.
Packit 63bb0d
//
Packit 63bb0d
//    var strPtr *string
Packit 63bb0d
//
Packit 63bb0d
//    // Without the SDK's conversion functions
Packit 63bb0d
//    str := "my string"
Packit 63bb0d
//    strPtr = &str
Packit 63bb0d
//
Packit 63bb0d
//    // With the SDK's conversion functions
Packit 63bb0d
//    strPtr = aws.String("my string")
Packit 63bb0d
//
Packit 63bb0d
//    // Convert *string to string value
Packit 63bb0d
//    str = aws.StringValue(strPtr)
Packit 63bb0d
//
Packit 63bb0d
// In addition to scalars the aws package also includes conversion utilities for
Packit 63bb0d
// map and slice for commonly types used in API parameters. The map and slice
Packit 63bb0d
// conversion functions use similar naming pattern as the scalar conversion
Packit 63bb0d
// functions.
Packit 63bb0d
//
Packit 63bb0d
//    var strPtrs []*string
Packit 63bb0d
//    var strs []string = []string{"Go", "Gophers", "Go"}
Packit 63bb0d
//
Packit 63bb0d
//    // Convert []string to []*string
Packit 63bb0d
//    strPtrs = aws.StringSlice(strs)
Packit 63bb0d
//
Packit 63bb0d
//    // Convert []*string to []string
Packit 63bb0d
//    strs = aws.StringValueSlice(strPtrs)
Packit 63bb0d
//
Packit 63bb0d
// SDK Default HTTP Client
Packit 63bb0d
//
Packit 63bb0d
// The SDK will use the http.DefaultClient if a HTTP client is not provided to
Packit 63bb0d
// the SDK's Session, or service client constructor. This means that if the
Packit 63bb0d
// http.DefaultClient is modified by other components of your application the
Packit 63bb0d
// modifications will be picked up by the SDK as well.
Packit 63bb0d
//
Packit 63bb0d
// In some cases this might be intended, but it is a better practice to create
Packit 63bb0d
// a custom HTTP Client to share explicitly through your application. You can
Packit 63bb0d
// configure the SDK to use the custom HTTP Client by setting the HTTPClient
Packit 63bb0d
// value of the SDK's Config type when creating a Session or service client.
Packit 63bb0d
package aws