aws

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 8 Imported by: 25

Documentation

Index

Constants

View Source
const (
	// RegionUSEast1 is a helper constant for AWS configs.
	RegionUSEast1 = "us-east-1"
	// RegionUSWest is a helper constant for AWS configs.
	RegionUSWest = "us-west-1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AccessKey       string `envconfig:"AWS_ACCESS_KEY"`
	MFASerialNumber string `envconfig:"AWS_MFA_SERIAL_NUMBER"`
	Region          string `envconfig:"AWS_REGION"`
	RoleARN         string `envconfig:"AWS_ROLE_ARN"`
	SecretKey       string `envconfig:"AWS_SECRET_KEY"`
	SessionToken    string `envconfig:"AWS_SESSION_TOKEN"`
	// Endpoint is an optional endpoint URL (hostname only or fully qualified URI)
	// that overrides the default endpoint for a client. Leave the value as "nil"
	// to use the default endpoint. Currently, only the gizmo SNS Publisher is
	// using this value. Note that AWS emulators (such as localstack) often have
	// different endpoint URL for each emulated service.
	EndpointURL *string `envconfig:"AWS_ENDPOINT_URL"`
}

Config holds common AWS credentials and keys.

func LoadConfigFromEnv

func LoadConfigFromEnv() Config

LoadConfigFromEnv will attempt to load the Config struct from environment variables.

type DynamoDB

type DynamoDB struct {
	Config
	TableName string `envconfig:"AWS_DYNAMODB_TABLE_NAME"`
}

DynamoDB holds some basic info required to work with Amazon DynamoDB.

func LoadDynamoDBFromEnv

func LoadDynamoDBFromEnv() DynamoDB

LoadDynamoDBFromEnv will attempt to load the DynamoDB struct from environment variables. If not populated, nil is returned.

type ElastiCache

type ElastiCache struct {
	Config
	ClusterID string `envconfig:"AWS_ELASTICACHE_CLUSTER_ID"`
}

ElastiCache holds the basic info required to work with Amazon ElastiCache.

func LoadElastiCacheFromEnv

func LoadElastiCacheFromEnv() ElastiCache

LoadElastiCacheFromEnv will attempt to load the ElasiCache struct from environment variables.

func (*ElastiCache) MustClient

func (e *ElastiCache) MustClient() *memcache.Client

MustClient will use the cache cluster ID to describe the cache cluster and instantiate a memcache.Client with the cache nodes returned from AWS.

type S3

type S3 struct {
	Config
	Bucket string `envconfig:"AWS_S3_BUCKET_NAME"`
}

S3 holds the info required to work with Amazon S3.

func LoadS3FromEnv

func LoadS3FromEnv() S3

LoadS3FromEnv will attempt to load the S3 struct from environment variables.

Jump to

Keyboard shortcuts

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