cmd

package
v2.6.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2018 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ScannerParallelQueries = 16

Variables

View Source
var (
	ReasonSkip            = *color.New(color.FgYellow)
	ReasonError           = *color.New(color.FgRed)
	ReasonRemoveTriggered = *color.New(color.FgGreen)
	ReasonWaitPending     = *color.New(color.FgBlue)
	ReasonSuccess         = *color.New(color.FgGreen)
)
View Source
var (
	ColorRegion             = *color.New(color.Bold)
	ColorResourceType       = *color.New()
	ColorResourceID         = *color.New(color.Bold)
	ColorResourceProperties = *color.New(color.Italic)
)
View Source
var (
	BuildVersion     = "unknown"
	BuildDate        = "unknown"
	BuildHash        = "unknown"
	BuildEnvironment = "unknown"
)

Functions

func IsTrue

func IsTrue(s string) bool

func Log

func Log(region Region, resourceType string, r resources.Resource, c color.Color, msg string)

func NewResourceTypesCommand added in v1.4.0

func NewResourceTypesCommand() *cobra.Command

func NewRootCommand

func NewRootCommand() *cobra.Command

func NewVersionCommand

func NewVersionCommand() *cobra.Command

func Prompt

func Prompt(expect string) error

func ResolveResourceTypes added in v1.4.0

func ResolveResourceTypes(base types.Collection, include, exclude []types.Collection) types.Collection

func Scan

func Scan(region Region, resourceTypes []string) <-chan *Item

Types

type Item

type Item struct {
	Resource resources.Resource

	State  ItemState
	Reason string

	Region Region
	Type   string
}

An Item describes an actual AWS resource entity with the current state and some metadata.

func (*Item) Equals

func (i *Item) Equals(o resources.Resource) bool

func (*Item) GetProperty

func (i *Item) GetProperty(key string) (string, error)

func (*Item) List added in v1.4.0

func (i *Item) List() ([]resources.Resource, error)

List gets all resource items of the same resource type like the Item.

func (*Item) Print

func (i *Item) Print()

type ItemState

type ItemState int
const (
	ItemStateNew ItemState = iota
	ItemStatePending
	ItemStateWaiting
	ItemStateFailed
	ItemStateFiltered
	ItemStateFinished
)

States of Items based on the latest request to AWS.

type Nuke

type Nuke struct {
	Parameters NukeParameters
	Account    awsutil.Account
	Config     *config.Nuke

	ResourceTypes types.Collection

	ForceSleep time.Duration
	// contains filtered or unexported fields
}

func NewNuke

func NewNuke(params NukeParameters, account awsutil.Account) *Nuke

func (*Nuke) Filter

func (n *Nuke) Filter(item *Item) error

func (*Nuke) HandleQueue

func (n *Nuke) HandleQueue()

func (*Nuke) HandleRemove

func (n *Nuke) HandleRemove(item *Item)

func (*Nuke) HandleWait

func (n *Nuke) HandleWait(item *Item, cache map[string][]resources.Resource)

func (*Nuke) Run

func (n *Nuke) Run() error

func (*Nuke) Scan

func (n *Nuke) Scan() error

type NukeParameters

type NukeParameters struct {
	ConfigPath string

	Targets  []string
	Excludes []string

	NoDryRun bool
	Force    bool

	MaxWaitRetries int
}

func (*NukeParameters) Validate

func (p *NukeParameters) Validate() error

type Queue

type Queue []*Item

func (Queue) Count

func (q Queue) Count(states ...ItemState) int

func (Queue) CountTotal

func (q Queue) CountTotal() int

type Region added in v1.4.0

type Region struct {
	Name    string
	Session *session.Session
}

Jump to

Keyboard shortcuts

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