internal

package
v0.0.0-...-2cc2960 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckError

func CheckError(err error, logFunc func(tpl string, args ...interface{}))

func Contains

func Contains(arr []string, elem string) bool

func MatchAny

func MatchAny(str string, regExps []string) (bool, error)

func UniqueAppend

func UniqueAppend(arr []string, elem string) []string

Types

type AWS

type AWS struct {
	// contains filtered or unexported fields
}

func NewAWSClient

func NewAWSClient(conf func(ctx context.Context, optFns ...func(*config.LoadOptions) error) (cfg aws.Config, err error),
	ec2InitFunc func(cfg aws.Config, optFns ...func(*ec2.Options)) *ec2.Client) *AWS

func NewFromInterface

func NewFromInterface(ec2 Ec2client) *AWS

func (AWS) DeleteVolume

func (a AWS) DeleteVolume(volumeId string, dryrun bool) error

func (AWS) DeregisterImage

func (a AWS) DeregisterImage(imageId string, dryRun bool) error

func (AWS) DescribeImages

func (a AWS) DescribeImages(accountId string) ([]ec2Types.Image, error)

func (AWS) GetAvailableEBSVolumes

func (a AWS) GetAvailableEBSVolumes() []ec2Types.Volume

func (*AWS) GetUsedAMIsFromEC2

func (a *AWS) GetUsedAMIsFromEC2() []string

func (*AWS) GetUsedAMIsFromLaunchTpls

func (a *AWS) GetUsedAMIsFromLaunchTpls() []string

type Ec2client

type Ec2client interface {
	DescribeInstances(ctx context.Context, params *ec2.DescribeInstancesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error)
	DescribeImages(ctx context.Context, params *ec2.DescribeImagesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeImagesOutput, error)
	DeregisterImage(ctx context.Context, params *ec2.DeregisterImageInput, optFns ...func(*ec2.Options)) (*ec2.DeregisterImageOutput, error)
	DescribeLaunchTemplateVersions(ctx context.Context, params *ec2.DescribeLaunchTemplateVersionsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeLaunchTemplateVersionsOutput, error)
	DescribeVolumes(ctx context.Context, params *ec2.DescribeVolumesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeVolumesOutput, error)
	DeleteVolume(ctx context.Context, params *ec2.DeleteVolumeInput, optFns ...func(*ec2.Options)) (*ec2.DeleteVolumeOutput, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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