config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_REDIS_HOST      = "127.0.0.1"
	DEFAULT_REDIS_PORT      = uint32(6379)
	DEFAULT_SWEEP_SCHEDULE  = "@daily"
	DEFAULT_MARK_SCHEDULE   = "@hourly"
	DEFAULT_NOTIFY_SCHEDULE = "@every 12h"
	DEFAULT_GRACEPERIOD     = "24h"
	DEFAULT_MAX_RETRY       = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Aws

type Aws struct {
	Name           string     `yaml:"name" validate:"nonzero"`
	MaxClientRetry int        `yaml:"max_retries"`
	Candidates     []string   `yaml:"candidates" validate:"isValidAwsCandidate"`
	Region         string     `yaml:"region" validate:"nonzero"`
	MarkSchedule   string     `yaml:"mark_schedule" validate:"isCron"`
	SweepSchedule  string     `yaml:"sweep_schedule" validate:"isCron"`
	NotifySchedule string     `yaml:"notify_schedule" validate:"isCron"`
	Not            []AwsTagKV `yaml:"not_tags"`
	GracePeriod    string     `yaml:"grace_period" validate:"isDuration"`
	DeleteEnabled  bool       `yaml:"delete_enabled"`
	IamRole        string     `yaml:"iamRole" validate:"nonzero"`
}

type AwsTagKV

type AwsTagKV struct {
	Key        string `yaml:"key"`
	Value      string `yaml:"value"`
	KeyRegex   string `yaml:"key_regex" validate:"isRegex"`
	ValueRegex string `yaml:"value_regex" validate:"isRegex"`
}

type Config

type Config struct {
	RedisHost  string       `yaml:"redis_host"`
	RedisPort  uint32       `yaml:"redis_port"`
	Aws        []Aws        `yaml:"aws"`
	Kubernetes []Kubernetes `yaml:"kubernetes"`
	Slack      Slack        `yaml:"slack"`
}

func LoadConfig

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

type Kubernetes

type Kubernetes struct {
	Name           string   `yaml:"name" validate:"nonzero"`
	KubeConfig     string   `yaml:"kubeconfig" validate:"nonzero"`
	KubeContext    string   `yaml:"kubecontext"`
	MarkSchedule   string   `yaml:"mark_schedule" validate:"isCron"`
	SweepSchedule  string   `yaml:"sweep_schedule" validate:"isCron"`
	NotifySchedule string   `yaml:"notify_schedule" validate:"isCron"`
	DeleteEnabled  bool     `yaml:"delete_enabled"`
	GracePeriod    string   `yaml:"grace_period" validate:"isDuration"`
	Not            []string `yaml:"not_namespaces"`
	NotRegex       []string `yaml:"not_regex" validate:"isRegex"`
}

type Slack

type Slack struct {
	Token        string `yaml:"token"`
	DefaultOwner string `yaml:"default_owner"`
	Channel      string `yaml:"channel"`
}

Jump to

Keyboard shortcuts

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