backup

package
v0.0.0-...-46ee869 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackupUrl  = baseUrl + "/backups"
	RestoreUrl = baseUrl + "/restores"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupConfig

type BackupConfig struct {
	Directory string `json:"directory" validate:"required"`
	// +optional
	Resources Resources `json:"resources,omitempty"`
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(podName string, http client.HttpClient) *Manager

NewManager creates a new instance of BackupManager

func (*Manager) Backup

func (manager *Manager) Backup(name string, config *BackupConfig) error

func (*Manager) BackupStatus

func (manager *Manager) BackupStatus(name string) (Status, error)

func (*Manager) Restore

func (manager *Manager) Restore(name string, config *RestoreConfig) error

func (*Manager) RestoreStatus

func (manager *Manager) RestoreStatus(name string) (Status, error)

type ManagerInterface

type ManagerInterface interface {
	Backup(name string, config *BackupConfig) error
	BackupStatus(name string) (Status, error)
	Restore(name string, config *RestoreConfig) error
	RestoreStatus(name string) (Status, error)
}

type Resources

type Resources struct {
	// +optional
	Caches []string `json:"caches,omitempty"`
	// +optional
	Templates []string `json:"templates,omitempty"`
	// +optional
	Counters []string `json:"counters,omitempty"`
	// +optional
	ProtoSchemas []string `json:"proto-schemas,omitempty"`
	// +optional
	Tasks []string `json:"tasks,omitempty"`
}

type RestoreConfig

type RestoreConfig struct {
	Location string `json:"location" validate:"required"`
	// +optional
	Resources Resources `json:"resources,omitempty"`
}

type Status

type Status string
const (
	// StatusSucceeded means that the backup process on the server has completed.
	StatusSucceeded Status = "Succeeded"
	// StatusRunning means that the backup is currently in progress on the infinispan server.
	StatusRunning Status = "Running"
	// StatusFailed means that the creation of backup failed on the infinispan server.
	StatusFailed Status = "Failed"
	// StatusUnknown means that the state of the backup could not be obtained, typically due to an error in communicating with the infinispan server.
	StatusUnknown Status = "Unknown"
)

Jump to

Keyboard shortcuts

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