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 ¶
- func AwsConfig(context context.T, service string) (awsConfig *aws.Config)
- func AwsConfigForEndpoint(context context.T, endpoint, region string) (awsConfig *aws.Config)
- func AwsConfigForRegion(context context.T, service, region string) (awsConfig *aws.Config)
- func GetAwsErrorCode(err error) string
- func HandleAwsError(log log.T, err error, stopPolicy *StopPolicy)
- type StopPolicy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AwsConfigForEndpoint ¶
AwsConfigForEndpoint returns the default aws.Config object with the appropriate credentials and endpoint.
func AwsConfigForRegion ¶
AwsConfigForRegion returns the default aws.Config object with the appropriate credentials and endpoint.
func GetAwsErrorCode ¶
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