cmd

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2017 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

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)
	ColorID               = *color.New(color.Bold)
	Warning               = *color.New(color.FgYellow)
)
View Source
var (
	BuildVersion     = "unknown"
	BuildDate        = "unknown"
	BuildHash        = "unknown"
	BuildEnvironment = "unknown"
)

Functions

func Log

func Log(reg string, r resources.Resource, c color.Color, msg string)

func LogErrorf

func LogErrorf(err error)

func LogWarn added in v1.3.0

func LogWarn(s string, i ...interface{})

func NewRootCommand

func NewRootCommand() *cobra.Command

func NewVersionCommand

func NewVersionCommand() *cobra.Command

func Prompt

func Prompt(expect string) error

func Scan

func Scan(sess *session.Session) <-chan *Item

Types

type Item

type Item struct {
	Resource resources.Resource

	Service string
	Lister  resources.ResourceLister

	State  ItemState
	Region string
	Reason string
}

func (*Item) Print

func (i *Item) Print()

type ItemState

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

type Nuke

type Nuke struct {
	Parameters NukeParameters
	Config     *NukeConfig

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

func NewNuke

func NewNuke(params NukeParameters) *Nuke

func (*Nuke) Filter

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

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

func (*Nuke) StartSession

func (n *Nuke) StartSession() error

func (*Nuke) ValidateAccount

func (n *Nuke) ValidateAccount() error

type NukeConfig

type NukeConfig struct {
	AccountBlacklist []string                     `yaml:"account-blacklist"`
	Regions          []string                     `yaml:"regions"`
	Accounts         map[string]NukeConfigAccount `yaml:"accounts"`
}

func LoadConfig

func LoadConfig(path string) (*NukeConfig, error)

func (*NukeConfig) HasBlacklist

func (c *NukeConfig) HasBlacklist() bool

func (*NukeConfig) InBlacklist

func (c *NukeConfig) InBlacklist(searchID string) bool

type NukeConfigAccount

type NukeConfigAccount struct {
	Filters map[string][]string `yaml:"filters"`
}

type NukeParameters

type NukeParameters struct {
	ConfigPath string

	Profile         string
	AccessKeyID     string
	SecretAccessKey string

	Targets []string

	NoDryRun bool
	Force    bool
}

func (*NukeParameters) Validate

func (p *NukeParameters) Validate() error

func (*NukeParameters) WantsTarget

func (p *NukeParameters) WantsTarget(name string) bool

type Queue

type Queue []*Item

func (Queue) Count

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

func (Queue) CountTotal

func (q Queue) CountTotal() int

Jump to

Keyboard shortcuts

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