awsutils

package module
v0.0.0-...-0490d70 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 8 Imported by: 4

README

Shared AWS Utilities for Northwood Labs

This is only a library. It does not work on its own. It is consumed by the various apps.

Usage

import (
    "github.com/northwood-labs/awsutils"
    "github.com/northwood-labs/golang-utils/exiterrorf"
)

func main() {
    ctx := context.Background()
    region := "us-west-2"
    retries := 5
    verbose := false

    config, err := awsutils.GetAWSConfig(ctx, region, retries, verbose)
    if err != nil {
        exiterrorf.ExitErrorf(err)
    }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAWSConfig

func GetAWSConfig(ctx context.Context, opts ...AWSConfigOptions) (aws.Config, error)

GetAWSConfig returns a standard AWS config object pre-configured for use with regions, retries, and verbosity.

If region is empty, we will attempt to read AWS_REGION then AWS_DEFAULT_REGION.

Types

type AWSConfigOptions

type AWSConfigOptions struct {
	Region  string
	Profile string
	Retries int
	Verbose bool
}

NoOpRateLimit to prevent limiting of queries to AWS.

type NoOpRateLimit

type NoOpRateLimit struct{}

NoOpRateLimit to prevent limiting of queries to AWS.

func (NoOpRateLimit) AddTokens

func (NoOpRateLimit) AddTokens(uint) error

AddTokens to return nil for NoOpRateLimit.

func (NoOpRateLimit) GetToken

func (NoOpRateLimit) GetToken(context.Context, uint) (func() error, error)

GetToken will return nil so that there will be no rate limiting.

Jump to

Keyboard shortcuts

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