manager

package
v0.0.0-...-160a1fa Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOrchestrator

func GetOrchestrator(name string, orchs Orchestrators) (o orchestrators.Orchestrator, err error)

GetOrchestrator returns an orchestrator interface based on the name you specified or on the orchestrator Volback is running on

func RunCmd

func RunCmd(p Provider, o orchestrators.Orchestrator, v *volume.Volume, cmd, cmdKey string) (err error)

RunCmd runs a command into a container

func Start

func Start(buildInfo utils.BuildInfo, o orchestrators.Orchestrator, s Server, volumeFilters volume.Filters, providersFile, targetURL, logServer, agentImage string, retryCount int, refreshTime int, parallelCount int) (err error)

Start starts a Volback manager which handle backups management

Types

type Manager

type Manager struct {
	Orchestrator orchestrators.Orchestrator
	Volumes      []*volume.Volume
	Server       *Server
	Providers    *Providers
	TargetURL    string
	RetryCount   int
	LogServer    string
	BuildInfo    utils.BuildInfo
	AgentImage   string
	// contains filtered or unexported fields
}

Manager contains all informations used by the Volback manager

func (*Manager) BackupVolume

func (m *Manager) BackupVolume(volumeID string, force bool) (err error)

BackupVolume does a backup of a volume

func (*Manager) GetInformations

func (m *Manager) GetInformations() (informations map[string]string)

GetInformations returns informations regarding the Volback manager

func (*Manager) RestoreVolume

func (m *Manager) RestoreVolume(
	volumeID string,
	force bool,
	snapshotName string,
) (err error)

RestoreVolume does a restore of a volume

func (*Manager) RunResticCommand

func (m *Manager) RunResticCommand(v *volume.Volume, cmd []string) (output string, err error)

RunResticCommand runs a custom Restic command

func (*Manager) StartServer

func (m *Manager) StartServer() (err error)

StartServer starts the API server

type Orchestrators

type Orchestrators struct {
	Docker     orchestrators.DockerConfig
	Cattle     orchestrators.CattleConfig
	Kubernetes orchestrators.KubernetesConfig
}

Orchestrators groups the parameters of all supported orchestrators in one structure

type Provider

type Provider struct {
	Name           string `toml:"-"`
	PreCmd         string `toml:"pre_cmd"`
	PostCmd        string `toml:"post_cmd"`
	DetectionCmd   string `toml:"detect_cmd"`
	BackupDir      string `toml:"backup_dir"`
	RestorePostCmd string `toml:"restore_post_cmd"`
	RestorePreCmd  string `toml:"restore_pre_cmd"`
}

Provider stores data for one provider

type Providers

type Providers struct {
	Providers map[string]Provider
}

Providers stores the list of available providers

func LoadProviders

func LoadProviders(path string) (providers Providers, err error)

LoadProviders returns the list of providers from the provider config file

func (*Providers) GetProvider

func (providers *Providers) GetProvider(o orchestrators.Orchestrator, v *volume.Volume) (prov Provider, err error)

GetProvider returns a provider based on detection commands

type Server

type Server struct {
	Address string
	PSK     string
}

Server contains informations used by the server part

Jump to

Keyboard shortcuts

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