config

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EnvVarConfigPath  = "BACKREST_CONFIG"         // path to config file
	EnvVarDataDir     = "BACKREST_DATA"           // path to data directory
	EnvVarBindAddress = "BACKREST_PORT"           // port to bind to (default 9898)
	EnvVarBinPath     = "BACKREST_RESTIC_COMMAND" // path to restic binary (default restic)
)
View Source
var ErrConfigNotFound = fmt.Errorf("config not found")

Functions

func BindAddress

func BindAddress() string

func ConfigFilePath

func ConfigFilePath() string

ConfigFilePath - *nix systems use $XDG_CONFIG_HOME/backrest/config.json - windows uses %APPDATA%/backrest/config.json

func DataDir

func DataDir() string

DataDir - *nix systems use $XDG_DATA_HOME/backrest - windows uses %APPDATA%/backrest/data

func NewDefaultConfig

func NewDefaultConfig() *v1.Config

func ResticBinPath

func ResticBinPath() string

func ValidateConfig

func ValidateConfig(c *v1.Config) error

Types

type CachingValidatingStore

type CachingValidatingStore struct {
	ConfigStore
	// contains filtered or unexported fields
}

func (*CachingValidatingStore) Get

func (c *CachingValidatingStore) Get() (*v1.Config, error)

func (*CachingValidatingStore) Update

func (c *CachingValidatingStore) Update(config *v1.Config) error

type ConfigStore

type ConfigStore interface {
	Get() (*v1.Config, error)
	Update(config *v1.Config) error
}

type JsonFileStore

type JsonFileStore struct {
	Path string
	// contains filtered or unexported fields
}

func (*JsonFileStore) Get

func (f *JsonFileStore) Get() (*v1.Config, error)

func (*JsonFileStore) Update

func (f *JsonFileStore) Update(config *v1.Config) error

type MemoryStore

type MemoryStore struct {
	Config *v1.Config
	// contains filtered or unexported fields
}

func (*MemoryStore) Get

func (c *MemoryStore) Get() (*v1.Config, error)

func (*MemoryStore) Update

func (c *MemoryStore) Update(config *v1.Config) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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