aws

package
v0.0.0-...-8b0f780 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

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 {
	SecretKey string `envconfig:"AWS_SECRET_KEY"`
	AccessKey string `envconfig:"AWS_ACCESS_KEY"`

	Region string `envconfig:"AWS_REGION"`
}

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