helpers

package
v0.0.0-...-869fb85 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ImplementedServices = Services{
	Service{
		Name:      "iam",
		Resources: iamResources,
	},
	Service{
		Name:      "ec2",
		Resources: ec2Resources,
	},
	Service{
		Name:      "cloudtrail",
		Resources: cloudTrailResources,
	},
	Service{
		Name:      "config",
		Resources: configResources,
	},
	Service{
		Name:      "kms",
		Resources: kmsResources,
	},
	Service{
		Name:      "s3",
		Resources: s3Resources,
	},
}

Functions

func Critical

func Critical(loggrs []interface{}, message string)

Critical writes entry to provided loggers

func Debug

func Debug(loggrs []interface{}, message string)

Debug writes entry to provided loggers

func DeleteFile

func DeleteFile(path string) (err error)

func Error

func Error(loggrs []interface{}, message string)

Error writes entry to provided loggers

func GetAssumeRoleCreds

func GetAssumeRoleCreds(input GetAssumeRoleCredsInput) (creds *credentials.Credentials, err error)

func GetResourceParts

func GetResourceParts(input string) (service, resource string, err error)

func GetSession

func GetSession() (sess *session.Session)

func GetStringInBetween

func GetStringInBetween(str, start, end string) (result string)

func GetignoredResourceParts

func GetignoredResourceParts(input string) (accountID, region, service, resource, resourceID string, err error)

func Info

func Info(loggrs []interface{}, message string)

Info writes entry to provided loggers

func Map

func Map(vs []string, f func(string) string) []string

func Notice

func Notice(loggrs []interface{}, message string)

Notice writes entry to provided loggers

func NumBetween

func NumBetween(value, floor, ceiling int64) (result bool)

func OutputError

func OutputError(err error)

func PadToWidth

func PadToWidth(input, char string, inputLengthOverride int, trimToWidth bool) (output string)

func PostSlackMessage

func PostSlackMessage(config root.Slack, input PostSlackMessageInput) (err error)

func PtrToStr

func PtrToStr(s string) *string

PtrToStr returns a pointer to an existing string

func Send

func Send(input ses.SendEmailInput, region string) (err error)

func StringInSlice

func StringInSlice(a string, list []string) bool

func StringInSliceContents

func StringInSliceContents(a string, list []string) bool

func StringSliceToLower

func StringSliceToLower(input []string) (output []string)

func ToInt64

func ToInt64(input interface{}) (output int64, err error)

func Warn

func Warn(loggrs []interface{}, message string)

Warn writes entry to provided loggers

Types

type Criteria

type Criteria []Criterion

type Criterion

type Criterion struct {
	Name        string
	Comparisons []string
	Units       []string
}

type GetAssumeRoleCredsInput

type GetAssumeRoleCredsInput struct {
	Sess       *session.Session
	AccountID  string
	RoleArn    string
	RoleName   string
	ExternalID string
}

type PostSlackMessageInput

type PostSlackMessageInput struct {
	User    string
	Color   string
	PreText string
	Title   string
	Text    []string
}

type Resource

type Resource struct {
	Name     string
	Criteria Criteria
}

type Resources

type Resources []Resource

type Service

type Service struct {
	Name      string
	Resources []Resource
}

type Services

type Services []Service

Jump to

Keyboard shortcuts

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