cfg

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RestoreS3EndpointEnvName        = "RESTORE_S3ENDPOINT"
	RestoreS3AccessKeyIDEnvName     = "RESTORE_ACCESSKEYID"
	RestoreS3SecretAccessKeyEnvName = "RESTORE_SECRETACCESSKEY"

	ResticRepositoryEnvName = "RESTIC_REPOSITORY"
	ResticPasswordEnvName   = "RESTIC_PASSWORD"

	AwsAccessKeyIDEnvName     = "AWS_ACCESS_KEY_ID"
	AwsSecretAccessKeyEnvName = "AWS_SECRET_ACCESS_KEY"

	AzureAccountEnvName    = "AZURE_ACCOUNT_NAME"
	AzureAccountKeyEnvName = "AZURE_ACCOUNT_KEY"

	GcsProjectIDEnvName   = "GOOGLE_PROJECT_ID"
	GcsAccessTokenEnvName = "GOOGLE_ACCESS_TOKEN"

	B2AccountIDEnvName  = "B2_ACCOUNT_ID"
	B2AccountKeyEnvName = "B2_ACCOUNT_KEY"

	RestUserEnvName     = "USER"
	RestPasswordEnvName = "PASSWORD"
)

Variables

View Source
var (
	Config = NewDefaultConfig()
)

Functions

func GetGlobalRepository

func GetGlobalRepository() string

GetGlobalRepository is a shortcut for building an S3 string "s3:<endpoint>/<bucket>"

Types

type Configuration

type Configuration struct {
	MountPath                        string `koanf:"datapath"`
	BackupAnnotation                 string `koanf:"annotation"`
	BackupCommandAnnotation          string `koanf:"backupcommandannotation"`
	FileExtensionAnnotation          string `koanf:"fileextensionannotation"`
	ServiceAccount                   string `koanf:"podexecaccountname"`
	BackupCheckSchedule              string `koanf:"checkschedule"`
	GlobalAccessKey                  string `koanf:"globalaccesskeyid"`
	GlobalKeepJobs                   int    `koanf:"globalkeepjobs"`
	GlobalRepoPassword               string `koanf:"globalrepopassword"`
	GlobalRestoreS3AccessKey         string `koanf:"globalrestores3accesskeyid"`
	GlobalRestoreS3Bucket            string `koanf:"globalrestores3bucket"`
	GlobalRestoreS3Endpoint          string `koanf:"globalrestores3endpoint"`
	GlobalRestoreS3SecretAccessKey   string `koanf:"globalrestores3secretaccesskey"`
	GlobalS3Bucket                   string `koanf:"globals3bucket"`
	GlobalS3Endpoint                 string `koanf:"globals3endpoint"`
	GlobalSecretAccessKey            string `koanf:"globalsecretaccesskey"`
	GlobalStatsURL                   string `koanf:"globalstatsurl"`
	GlobalConcurrentArchiveJobsLimit int    `koanf:"global-concurrent-archive-jobs-limit"`
	GlobalConcurrentBackupJobsLimit  int    `koanf:"global-concurrent-backup-jobs-limit"`
	GlobalConcurrentCheckJobsLimit   int    `koanf:"global-concurrent-check-jobs-limit"`
	GlobalConcurrentPruneJobsLimit   int    `koanf:"global-concurrent-prune-jobs-limit"`
	GlobalConcurrentRestoreJobsLimit int    `koanf:"global-concurrent-restore-jobs-limit"`
	GlobalCPUResourceRequest         string `koanf:"global-cpu-request"`
	GlobalCPUResourceLimit           string `koanf:"global-cpu-limit"`
	GlobalMemoryResourceRequest      string `koanf:"global-memory-request"`
	GlobalMemoryResourceLimit        string `koanf:"global-memory-limit"`
	BackupImage                      string `koanf:"image"`
	MetricsBindAddress               string `koanf:"metrics-bindaddress"`
	PodExecRoleName                  string `koanf:"podexecrolename"`
	PodFilter                        string `koanf:"podfilter"`
	PromURL                          string `koanf:"promurl"`
	RestartPolicy                    string `koanf:"restartpolicy"`

	// Enabling this will ensure there is only one active controller manager.
	EnableLeaderElection bool   `koanf:"enable-leader-election"`
	LogLevel             string `koanf:"log-level"`
	OperatorNamespace    string `koanf:"operator-namespace"`
}

Configuration holds a strongly-typed tree of the configuration

func NewDefaultConfig

func NewDefaultConfig() *Configuration

NewDefaultConfig retrieves the config with sane defaults

func (Configuration) GetGlobalDefaultResources

func (c Configuration) GetGlobalDefaultResources() (res corev1.ResourceRequirements)

func (Configuration) ValidateSyntax

func (c Configuration) ValidateSyntax() error

Jump to

Keyboard shortcuts

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