apis

package
v0.0.0-...-a8b43d5 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CharSet for SES email
	CharSet = "UTF-8"
)

Variables

This section is empty.

Functions

func GetRegions

GetRegions will return a DescribeRegionsOutput stuct containing our slice of regions.

It requires that you pass an already created session.

func SendEmail

func SendEmail(sess *session.Session, htmlBody string)

SendEmail tasks in a currently created session and the htmlbody which you would like to send. The func is also looking to the SENDER and RECIPIENT OS environment variables to be set.

Types

type APIMap

type APIMap map[string][]Ec2instance

APIMap stores the Region name are the key and a slice of Ec2Instance structs for use later

func GetInstances

func GetInstances(regions *ec2.DescribeRegionsOutput) []APIMap

GetInstances takes a pointer to a DescribeRegionsOutput to query all of the instances in a region and build on our Ec2instance struct The Ec2instance structs will be stored as a slice in a map to organized in fashion that can easily we looped over.GetInstances

Example: map[us-east-1:[{i-030b2417f941cdbbf t2.micro 2018-06-28 17:11:20 +0000 UTC stopped aw-mac us-east-1}]]

type DescribeRegioner

type DescribeRegioner interface {
	DescribeRegionsWithContext(aws.Context, *ec2.DescribeRegionsInput, ...request.Option) (*ec2.DescribeRegionsOutput, error)
}

type Ec2instance

type Ec2instance struct {
	Instanceid string
	Type       string
	LaunchTime *time.Time
	State      string
	KeyName    string
}

Ec2instance struct to hold all of our ec2 instance metadata

type S3Bucket

type S3Bucket struct {
	Name     string
	Location string
	Size     string
}

S3Bucket for struct type containing information about S3 buckets

func GetS3Buckets

func GetS3Buckets() []S3Bucket

GetS3Buckets function used to grab a list of S3 buckets and their sizes

Jump to

Keyboard shortcuts

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