utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAWSSession added in v0.2.0

func GetAWSSession(parameters map[string]interface{}, creds []byte, defaultRegion string) (*session.Session, error)
GetAWSSession returns an aws.session.Session based on the parameters or environment variables

* If parameters are not present or incomplete (secret key, access key AND region) * then let default config loading order to go on: * https://docs.aws.amazon.com/sdk-for-go/api/aws/session/

func RandomBytes

func RandomBytes(n int) ([]byte, error)

RandomBytes generate random bytes

func RandomInt

func RandomInt() (int64, error)

RandomInt returns a random int64

func RandomStringObjectSafe

func RandomStringObjectSafe(n int) (string, error)

RandomStringObjectSafe returns a random string that is safe to use as an k8s object Name

https://kubernetes.io/docs/concepts/overview/working-with-objects/names/

Types

type AWSCredentials added in v0.2.0

type AWSCredentials struct {
	AccessKeyID     string
	SecretAccessKey string
	SessionToken    string
}

AWSCredentials represents expected credentials

Jump to

Keyboard shortcuts

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