sdkutil

package
v0.0.0-...-955c50f Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 14 Imported by: 26

Documentation

Overview

Package sdkutil provides utilities used to call awssdk.

Package sdkutil provides utilities used to call awssdk.

Package sdkutil provides utilities used to call awssdk.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AwsConfig

func AwsConfig(context context.T, service string) (awsConfig *aws.Config)

AwsConfig returns the default aws.Config object with the appropriate credentials.

func AwsConfigForEndpoint

func AwsConfigForEndpoint(context context.T, endpoint, region string) (awsConfig *aws.Config)

AwsConfigForEndpoint returns the default aws.Config object with the appropriate credentials and endpoint.

func AwsConfigForRegion

func AwsConfigForRegion(context context.T, service, region string) (awsConfig *aws.Config)

AwsConfigForRegion returns the default aws.Config object with the appropriate credentials and endpoint.

func GetAwsErrorCode

func GetAwsErrorCode(err error) string

GetAwsErrorCode tries to return AwsError code

func HandleAwsError

func HandleAwsError(log log.T, err error, stopPolicy *StopPolicy)

HandleAwsError logs an AWS error.

Types

type StopPolicy

type StopPolicy struct {
	Name string

	MaximumErrorThreshold int
	SyncObject            *sync.Mutex
	// contains filtered or unexported fields
}

StopPolicy specifies the execution policy on data points like errors, duration

func NewStopPolicy

func NewStopPolicy(name string, errorThreshold int) *StopPolicy

NewStopPolicy creates an object of StopPolicy

func (*StopPolicy) AddErrorCount

func (s *StopPolicy) AddErrorCount(x int)

AddErrorCount increments the error count by the set amount

func (*StopPolicy) HasError

func (s *StopPolicy) HasError() bool

HasError returns true if the policy contains error

func (*StopPolicy) IsHealthy

func (s *StopPolicy) IsHealthy() (healthy bool)

IsHealthy returns true if the policy determines the handler is safe to call otherwise false.

func (*StopPolicy) ProcessException

func (s *StopPolicy) ProcessException(err error)

ProcessException sets provides a default implementation when errors occur

func (*StopPolicy) ResetErrorCount

func (s *StopPolicy) ResetErrorCount()

ResetErrorCount resets the error count, typically on successful operation

func (*StopPolicy) String

func (s *StopPolicy) String() string

String returns the string representation of the stop policy

Directories

Path Synopsis
Package retryer overrides the default aws sdk retryer delay logic to better suit the mds needs
Package retryer overrides the default aws sdk retryer delay logic to better suit the mds needs

Jump to

Keyboard shortcuts

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