Documentation
¶
Index ¶
- Constants
- func AddFlagsToCommand(cmd *cobra.Command, backend bool)
- func ArrayContains[T comparable](arr []T, needle T) bool
- func CheckConfig() error
- func CheckIfCommandIsCallable(cmd string) bool
- func CheckIfResticIsCallable() bool
- func CheckIfVolumeExists(volume string) bool
- func CopyFile(from, to string) error
- func ExecuteCommand(options ExecuteOptions, args ...string) (int, string, error)
- func ExecuteResticCommand(options ExecuteOptions, args ...string) (int, string, error)
- func GetAllOrSelected(cmd *cobra.Command, backends bool) ([]string, error)
- func GetPathRelativeToConfig(p string) (string, error)
- func RunCron() error
- type Backend
- type BackendRest
- type ColoredWriter
- type Config
- type ExecuteOptions
- type HookArray
- type Hooks
- type Location
- func (l Location) Backup(cron bool, specificBackend string) []error
- func (l Location) ExecuteHooks(commands []string, options ExecuteOptions) error
- func (l Location) Forget(prune bool, dry bool) error
- func (l Location) Restore(to, from string, force bool, snapshot string, options []string) error
- func (l Location) RunCron() error
- type LocationCopy
- type LocationForgetOption
- type LocationType
- type OptionMap
- type Options
Constants ¶
View Source
const VERSION = "1.8.3"
Variables ¶
This section is empty.
Functions ¶
func AddFlagsToCommand ¶
func ArrayContains ¶ added in v1.6.0
func ArrayContains[T comparable](arr []T, needle T) bool
func CheckConfig ¶
func CheckConfig() error
func CheckIfResticIsCallable ¶
func CheckIfResticIsCallable() bool
func CheckIfVolumeExists ¶ added in v1.5.0
func ExecuteCommand ¶
func ExecuteCommand(options ExecuteOptions, args ...string) (int, string, error)
func ExecuteResticCommand ¶
func ExecuteResticCommand(options ExecuteOptions, args ...string) (int, string, error)
func GetPathRelativeToConfig ¶
Types ¶
type Backend ¶
type Backend struct {
Type string `mapstructure:"type,omitempty"`
Path string `mapstructure:"path,omitempty"`
Key string `mapstructure:"key,omitempty"`
RequireKey bool `mapstructure:"requireKey,omitempty"`
Env map[string]string `mapstructure:"env,omitempty"`
Rest BackendRest `mapstructure:"rest,omitempty"`
Options Options `mapstructure:"options,omitempty"`
// contains filtered or unexported fields
}
func GetBackend ¶
type BackendRest ¶ added in v1.0.4
type ColoredWriter ¶ added in v1.7.0
type ColoredWriter struct {
// contains filtered or unexported fields
}
type Config ¶
type Config struct {
Version string `mapstructure:"version"`
Extras interface{} `mapstructure:"extras"`
Locations map[string]Location `mapstructure:"locations"`
Backends map[string]Backend `mapstructure:"backends"`
Global Options `mapstructure:"global"`
}
func (*Config) SaveConfig ¶ added in v1.0.4
type ExecuteOptions ¶
type Hooks ¶
type Hooks struct {
Dir string `mapstructure:"dir"`
PreValidate HookArray `mapstructure:"prevalidate,omitempty"`
Before HookArray `mapstructure:"before,omitempty"`
After HookArray `mapstructure:"after,omitempty"`
Success HookArray `mapstructure:"success,omitempty"`
Failure HookArray `mapstructure:"failure,omitempty"`
}
type Location ¶
type Location struct {
From []string `mapstructure:"from,omitempty"`
Type string `mapstructure:"type,omitempty"`
To []string `mapstructure:"to,omitempty"`
Hooks Hooks `mapstructure:"hooks,omitempty"`
Cron string `mapstructure:"cron,omitempty"`
Options Options `mapstructure:"options,omitempty"`
ForgetOption LocationForgetOption `mapstructure:"forget,omitempty"`
CopyOption LocationCopy `mapstructure:"copy,omitempty"`
// contains filtered or unexported fields
}
func GetLocation ¶
func (Location) ExecuteHooks ¶ added in v1.5.0
func (l Location) ExecuteHooks(commands []string, options ExecuteOptions) error
type LocationCopy ¶ added in v1.6.0
type LocationForgetOption ¶ added in v1.6.0
type LocationForgetOption string
const ( LocationForgetYes LocationForgetOption = "yes" LocationForgetNo LocationForgetOption = "no" LocationForgetPrune LocationForgetOption = "prune" )
type LocationType ¶
type LocationType string
const ( TypeLocal LocationType = "local" TypeVolume LocationType = "volume" )
Click to show internal directories.
Click to hide internal directories.