config

package
v2.10.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FilterTypeEmpty    FilterType = ""
	FilterTypeExact               = "exact"
	FilterTypeGlob                = "glob"
	FilterTypeRegex               = "regex"
	FilterTypeContains            = "contains"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Filters       Filters       `yaml:"filters"`
	ResourceTypes ResourceTypes `yaml:"resource-types"`
	Presets       []string      `yaml:"presets"`
}

type Filter

type Filter struct {
	Property string
	Type     FilterType
	Value    string
	Invert   string
}

func NewExactFilter

func NewExactFilter(value string) Filter

func (Filter) Match

func (f Filter) Match(o string) (bool, error)

func (*Filter) UnmarshalYAML

func (f *Filter) UnmarshalYAML(unmarshal func(interface{}) error) error

type FilterType

type FilterType string

type Filters

type Filters map[string][]Filter

func (Filters) Merge

func (f Filters) Merge(f2 Filters)

type Nuke

type Nuke struct {
	AccountBlacklist []string                     `yaml:"account-blacklist"`
	Regions          []string                     `yaml:"regions"`
	Accounts         map[string]Account           `yaml:"accounts"`
	ResourceTypes    ResourceTypes                `yaml:"resource-types"`
	Presets          map[string]PresetDefinitions `yaml:"presets"`
}

func Load

func Load(path string) (*Nuke, error)

func (*Nuke) Filters

func (c *Nuke) Filters(accountID string) (Filters, error)

func (*Nuke) HasBlacklist

func (c *Nuke) HasBlacklist() bool

func (*Nuke) InBlacklist

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

func (*Nuke) ValidateAccount

func (c *Nuke) ValidateAccount(accountID string, aliases []string) error

type PresetDefinitions

type PresetDefinitions struct {
	Filters Filters `yaml:"filters"`
}

type ResourceTypes

type ResourceTypes struct {
	Targets  types.Collection `yaml:"targets"`
	Excludes types.Collection `yaml:"excludes"`
}

Jump to

Keyboard shortcuts

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