config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = C{}

Functions

func HasCronSchedule

func HasCronSchedule() bool

func Load

func Load(configFile string) error

func Normalize

func Normalize(c *C) error

Types

type Auth

type Auth struct {
	User     string `yaml:"user"`
	Password string `yaml:"password"`
}

type C

type C struct {
	Host     string   `yaml:"host"`
	Version  string   `yaml:"version"`
	Auth     Auth     `yaml:"auth"`
	Projects []string `yaml:"projects"`
	Policy   Policy   `yaml:"policy"`
	Trigger  *Trigger `yaml:"trigger"`
}

type NotTouchedPolicy added in v0.3.0

type NotTouchedPolicy struct {
	// Time is time period in second.
	Time int64 `yaml:"time"`
}

NotTouchedPolicy cleans images that are recently not touched within given period

type NumPolicy

type NumPolicy struct {
	Num int `yaml:"number"`
}

type Policy

type Policy struct {
	// Type of the policy, e.g. "number", "regex", "recentlyNotTouched"
	Type string `yaml:"type"`
	// NumPolicy configures policy to retain given number tags in repo
	NumPolicy *NumPolicy `yaml:"numberPolicy,omitempty"`
	// RegexPolicy configures policy to clean images that match the regex patterns
	RegexPolicy *RegexPolicy `yaml:"regexPolicy,omitempty"`
	// TouchPolicy configures policy to clean images that are recently not touched within given period
	NotTouchedPolicy *NotTouchedPolicy `yaml:"notTouchedPolicy,omitempty"`
	// RetainTags is tag patterns to be retained
	RetainTags []string `yaml:"retainTags"`
}

type RegexPolicy

type RegexPolicy struct {
	// Repos contains list of regex to match repo name
	Repos []string `yaml:"repos"`
	/// Tags contains list of regex to match tag name
	Tags []string `yaml:"tags"`
}

RegexPolicy removes all images that match the given regex.

type Trigger

type Trigger struct {
	// Cron expression to regularly trigger the cleanup
	Cron string `yaml:"cron"`
}

Jump to

Keyboard shortcuts

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