aws

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

AWS-specific logic to handle execution and monitoring of batch jobs.

Index

Constants

View Source
const (
	EnvSharedCredFilePath                  = "AWS_SHARED_CREDENTIALS_FILE"
	EnvAwsProfile                          = "AWS_PROFILE"
	ErrEmptyCredentials   errors.ErrorCode = "EMPTY_CREDS"
	ErrUnknownHost        errors.ErrorCode = "UNKNOWN_HOST"
)
View Source
const ConfigSectionKey = "aws"

Variables

This section is empty.

Functions

func Init

func Init(ctx context.Context, cfg *Config) (err error)

Initializes singleton AWS Client if one hasn't been initialized yet.

func MustRegisterSubSection

func MustRegisterSubSection(key config.SectionKey, cfg config.Config) config.Section

func SetClient

func SetClient(c Client)

Types

type Client

type Client interface {
	GetSession() *session.Session
	GetSdkConfig() *aws.Config
	GetConfig() *Config
	GetHostName() string
}

A generic AWS Client that can be used for all AWS Client libraries.

func GetClient

func GetClient() (c Client, err error)

Gets singleton AWS Client.

type Config

type Config struct {
	Region               string          `json:"region" pflag:",AWS Region to connect to."`
	AccountID            string          `json:"accountId" pflag:",AWS Account Identifier."`
	Retries              int             `json:"retries" pflag:",Number of retries."`
	MaxErrorStringLength int             `json:"maxErrorLength" pflag:",Maximum size of error messages."`
	CatalogCacheTimeout  config.Duration `json:"catalog-timeout" pflag:"\"5s\",Timeout duration for checking catalog for all batch tasks"`
}

Config section for AWS Package

func GetConfig

func GetConfig() *Config

Gets loaded config for AWS

func (Config) GetPFlagSet

func (cfg Config) GetPFlagSet(prefix string) *pflag.FlagSet

GetPFlagSet will return strongly types pflags for all fields in Config and its nested types. The format of the flags is json-name.json-sub-name... etc.

type RateLimiterConfig

type RateLimiterConfig struct {
	Rate  int64 `json:"rate" pflag:",Allowed rate of calls per second."`
	Burst int   `json:"burst" pflag:",Allowed burst rate of calls."`
}

Jump to

Keyboard shortcuts

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