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 HooksList
- type Location
- func (l Location) Backup(cron bool, specificBackend string) []error
- func (l Location) ExecuteHooks(commands []string, directory 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) (errors []error)
- func (l Location) RunCron() error
- type LocationCopy
- type LocationForgetOption
- type LocationType
- type OptionMap
- type Options
Constants ¶
View Source
const VERSION = "1.7.5"
Variables ¶
This section is empty.
Functions ¶
func AddFlagsToCommand ¶
func ArrayContains ¶
func ArrayContains[T comparable](arr []T, needle T) bool
func CheckConfig ¶
func CheckConfig() error
func CheckIfResticIsCallable ¶
func CheckIfResticIsCallable() bool
func CheckIfVolumeExists ¶
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"` 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 ¶
type ColoredWriter ¶
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 ¶
type ExecuteOptions ¶
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 ¶
func (l Location) ExecuteHooks(commands []string, directory string, options ExecuteOptions) error
type LocationCopy ¶
type LocationForgetOption ¶
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.