aws

package
v1.9.33 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	EnvSharedCredFilePath                  = "AWS_SHARED_CREDENTIALS_FILE" // #nosec
	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
}

Client is 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."`
	LogLevel  aws.ClientLogMode `json:"logLevel" pflag:"-,Defines the Sdk Log Level."`
}

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.

func (Config) GetSdkConfig

func (cfg Config) GetSdkConfig() (aws.Config, error)

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