config

package
v0.0.0-...-d0e585f Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomEndpoints

type CustomEndpoints []*CustomRegion

type CustomRegion

type CustomRegion struct {
	Region                string         `yaml:"region"`
	Services              CustomServices `yaml:"services"`
	TLSInsecureSkipVerify bool           `yaml:"tls_insecure_skip_verify"`
}

type CustomService

type CustomService struct {
	Service               string `yaml:"service"`
	URL                   string `yaml:"url"`
	TLSInsecureSkipVerify bool   `yaml:"tls_insecure_skip_verify"`
}

type CustomServices

type CustomServices []*CustomService

type DisableDeletionProtection

type DisableDeletionProtection struct {
	ComputeInstance bool `yaml:"ComputeInstance"`
}

type FeatureFlags

type FeatureFlags struct {
	DisableDeletionProtection DisableDeletionProtection `yaml:"disable-deletion-protection"`
}

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
const (
	FilterTypeEmpty         FilterType = ""
	FilterTypeExact         FilterType = "exact"
	FilterTypeGlob          FilterType = "glob"
	FilterTypeRegex         FilterType = "regex"
	FilterTypeContains      FilterType = "contains"
	FilterTypeDateOlderThan FilterType = "dateOlderThan"
)

type Filters

type Filters map[string][]Filter

func (Filters) Merge

func (f Filters) Merge(f2 Filters)

type Nuke

type Nuke struct {
	ProjectRestrictedList []string                     `yaml:"project-restricted-list"`
	Projects              map[string]Project           `yaml:"projects"`
	ResourceTypes         ResourceTypes                `yaml:"resource-types"`
	Presets               map[string]PresetDefinitions `yaml:"presets"`
	FeatureFlags          FeatureFlags                 `yaml:"feature-flags"`
}

func Load

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

func (*Nuke) Filters

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

func (*Nuke) HasRestrictedList

func (c *Nuke) HasRestrictedList() bool

func (*Nuke) InBlocklist

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

func (*Nuke) ValidateProject

func (c *Nuke) ValidateProject(projectID string) error

type PresetDefinitions

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

type Project

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

type ResourceTypes

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

Jump to

Keyboard shortcuts

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