backup

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrInvalidConfig is wrapped within all errors from this pkg, and can be
	// used by downstream to identify errors
	ErrInvalidConfig = errors.New("invalid backup config")

	ErrInvalidProvider = fmt.Errorf("%w: invalid provider", ErrInvalidConfig)
)

Functions

This section is empty.

Types

type Config

type Config struct {

	// Name of Selected provider
	Selected string
	// contains filtered or unexported fields
}

Config holds the flag configuration for all providers

func NewConfig

func NewConfig(optionalMappings ...providerMap) *Config

func (*Config) AddToFlagSet

func (c *Config) AddToFlagSet(fs *pflag.FlagSet)

AddToFlagSet adds config's (and its providers') flagsets to fs

func (*Config) CreateSelectedProvider

func (c *Config) CreateSelectedProvider(ctx context.Context) (backup.Provider, error)

func (*Config) GetEnvVars

func (c *Config) GetEnvVars(fs *pflag.FlagSet) (envvars []corev1.EnvVar)

GetEnvVars converts the complete flagset into a list of k8s environment variable objects. Assumes config's flagset is present within fs, and assumes fs has been parsed.

func (*Config) Validate

func (c *Config) Validate(fs *pflag.FlagSet) error

Validate all user-specified flags

Jump to

Keyboard shortcuts

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