backup

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackupStatusSuccess = "success"
	BackupStatusStarted = "started"
	BackupStatusFailed  = "failed"
)
View Source
const (
	EventTopicBackupRun = "roles.backup.run"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIBackupStartInput

type APIBackupStartInput struct {
	Wait bool `query:"wait" required:"true"`
}

type APIBackupStatus

type APIBackupStatus struct {
	Node string `json:"node"`
	BackupStatus
}

type APIBackupStatusOutput

type APIBackupStatusOutput struct {
	Status []APIBackupStatus `json:"status" required:"true"`
}

type APIRoleConfigInput

type APIRoleConfigInput struct {
	Config RoleConfig `json:"config" required:"true"`
}

type APIRoleConfigOutput

type APIRoleConfigOutput struct {
	Config RoleConfig `json:"config" required:"true"`
}

type BackupStatus

type BackupStatus struct {
	Time     time.Time `json:"time" required:"true"`
	Status   string    `json:"status,omitempty" required:"true"`
	Error    string    `json:"error,omitempty" required:"true"`
	Filename string    `json:"filename,omitempty" required:"true"`
	Size     int64     `json:"size,omitempty" required:"true"`
	Duration int64     `json:"duration,omitempty" required:"true"`
}

type Role

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

func New

func New(instance roles.Instance) *Role

func (*Role) APIBackupStart

func (r *Role) APIBackupStart() usecase.Interactor

func (*Role) APIBackupStatus

func (r *Role) APIBackupStatus() usecase.Interactor

func (*Role) APIRoleConfigGet

func (r *Role) APIRoleConfigGet() usecase.Interactor

func (*Role) APIRoleConfigPut

func (r *Role) APIRoleConfigPut() usecase.Interactor

func (*Role) GetBackupName

func (r *Role) GetBackupName() string

func (*Role) SaveSnapshot

func (r *Role) SaveSnapshot(ctx context.Context) *BackupStatus

func (*Role) Start

func (r *Role) Start(ctx context.Context, config []byte) error

func (*Role) Stop

func (r *Role) Stop()

type RoleConfig

type RoleConfig struct {
	AccessKey string `json:"accessKey"`
	SecretKey string `json:"secretKey"`
	Endpoint  string `json:"endpoint"`
	Bucket    string `json:"bucket"`
	Path      string `json:"path"`
	CronExpr  string `json:"cronExpr"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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