utils

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const MaxRequeueDelaySeconds = 900

SQS imposed maximum message delay

Variables

View Source
var (
	// TimeNowFunc directs to the TimeNow function.
	// This is intended to be overridden for testing.
	TimeNowFunc = TimeNowRFC3339
)

Functions

func GenerateResourceID

func GenerateResourceID(awsAccountID string, region string, schema string) string

GenerateResourceID returns a formatted custom Resource ID.

func LogAWSError

func LogAWSError(apiCall string, err error)

LogAWSError logs an AWS error to zap in a digestable format.

func ParseTagSlice

func ParseTagSlice(slice interface{}) map[string]*string

ParseTagSlice takes a list of structs representing tags, and returns a map of key/value pairs

func ParseTimeRFC3339

func ParseTimeRFC3339(timeString string) time.Time

ParseTimeRFC3339 parses a time string into a valid RFC3339 time.

func Requeue

func Requeue(scanRequest poller.ScanMsg, delay int64) error

Requeue sends a scan request back to the poller input queue

func StringToDateTime

func StringToDateTime(timeString string) *time.Time

StringToDateTime parses a time string into a time.Time struct

func TimeNowRFC3339

func TimeNowRFC3339() time.Time

TimeNowRFC3339 returns the current time in RFC3339 format.

func UnixTimeToDateTime

func UnixTimeToDateTime(epochTimeStamp int64) *time.Time

UnixTimeToDateTime parses an Int64 representing an epoch timestamp to a time.Time struct

Types

type ParsedResourceID

type ParsedResourceID struct {
	AccountID string
	Region    string
	Schema    string
}

func ParseResourceID

func ParseResourceID(resourceID string) *ParsedResourceID

Jump to

Keyboard shortcuts

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