config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LogLevel             string `split_words:"true" default:"info" description:"Log level for the application"`
	LogFormat            string `split_words:"true" default:"json" description:"Accepted values: text and json"`
	Interval             string `split_words:"true" default:"60s" description:"Deletion interval"`
	CacheCleanupInterval string `split_words:"true" default:"30m" description:"Cache cleanup interval"`
	CacheExpiration      string `split_words:"true" default:"1.5h" description:"Default expiration time for cached data"`
	MaxErrAllowed        int    `` /* 196-byte string literal not displayed */
	Limit                int    `split_words:"true" default:"15" description:"Maximum number of Pods to be deleted per each POD_CLEANUP_INTERVAL tick"`
	Kubernetes           KubernetesConfig
}

func New

func New() Config

func (Config) GetCacheCleanupInterval

func (c Config) GetCacheCleanupInterval() (time.Duration, error)

func (Config) GetCacheExpiration

func (c Config) GetCacheExpiration() (time.Duration, error)

func (Config) GetInterval

func (c Config) GetInterval() (time.Duration, error)

func (Config) GetRequestLimit

func (c Config) GetRequestLimit() int

func (Config) GetRequestTimeout

func (c Config) GetRequestTimeout() (time.Duration, error)

type KubernetesConfig

type KubernetesConfig struct {
	RequestLimit   int      `split_words:"true" default:"500" description:"Limit the number of pods to retrieve per API request when getting existing pod"`
	RequestTimeout string   `split_words:"true" default:"30s" description:"The maximum amount of time a Kubernetes API request can take"`
	Namespaces     []string `split_words:"true" default:"default" description:"List of namespaces to search for Kubernetes pods"`
	Annotation     string   `split_words:"true" default:"pod-cleanup.gitlab.com/ttl" description:"List of annotations to consider for the ttl setting"`
}

Jump to

Keyboard shortcuts

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