sync

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	VolumeHeadName = "volume-head"
)

Variables

This section is empty.

Functions

func GetSnapshotsInfo

func GetSnapshotsInfo(replicas []*types.ControllerReplicaInfo) (outputDisks map[string]types.DiskInfo, err error)

Types

type BackupCreateInfo

type BackupCreateInfo struct {
	BackupID      string `json:"backupID"`
	IsIncremental bool   `json:"isIncremental"`
}

type BackupStatusInfo

type BackupStatusInfo struct {
	Progress       int    `json:"progress"`
	BackupURL      string `json:"backupURL,omitempty"`
	Error          string `json:"error,omitempty"`
	SnapshotName   string `json:"snapshotName"`
	State          string `json:"state"`
	ReplicaAddress string `json:"replicaAddress"`
}

func FetchBackupStatus added in v1.1.3

func FetchBackupStatus(client *replicaClient.ReplicaClient, backupID string, replicaAddr string) (*BackupStatusInfo, error)

type ReplicaError added in v1.0.1

type ReplicaError struct {
	Address string
	Message string
}

func NewReplicaError added in v1.0.1

func NewReplicaError(address string, err error) ReplicaError

func (ReplicaError) Error added in v1.0.1

func (e ReplicaError) Error() string

type ReplicaRebuildStatus

type ReplicaRebuildStatus struct {
	Error              string `json:"error"`
	IsRebuilding       bool   `json:"isRebuilding"`
	Progress           int    `json:"progress"`
	State              string `json:"state"`
	FromReplicaAddress string `json:"fromReplicaAddress"`
}

type RestoreStatus

type RestoreStatus struct {
	IsRestoring            bool   `json:"isRestoring"`
	Progress               int    `json:"progress,omitempty"`
	Error                  string `json:"error,omitempty"`
	Filename               string `json:"filename,omitempty"`
	State                  string `json:"state"`
	BackupURL              string `json:"backupURL"`
	LastRestored           string `json:"lastRestored"`
	CurrentRestoringBackup string `json:"currentRestoringBackup"`
}

type SnapshotPurgeStatus

type SnapshotPurgeStatus struct {
	Error     string `json:"error"`
	IsPurging bool   `json:"isPurging"`
	Progress  int    `json:"progress"`
	State     string `json:"state"`
}

type Task

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

func NewTask

func NewTask(ctx context.Context, controllerAddress string) (*Task, error)

NewTask creates new task with an initialized ControllerClient The lifetime of the Task::client is bound to the context lifetime client calls have their own contexts with timeouts for the call

func (*Task) AddReplica

func (t *Task) AddReplica(replica string) error

func (*Task) AddRestoreReplica added in v1.1.0

func (t *Task) AddRestoreReplica(replica string) error

func (*Task) CreateBackup

func (t *Task) CreateBackup(snapshot, dest, backingImageName, backingImageURL string, labels []string, credential map[string]string) (*BackupCreateInfo, error)

func (*Task) DeleteSnapshot

func (t *Task) DeleteSnapshot(snapshot string) error

func (*Task) FetchBackupStatus

func (t *Task) FetchBackupStatus(backupID string, replicaAddr string) (*BackupStatusInfo, error)

FetchBackupStatus instance method is @deprecated use the free function FetchBackupStatus instead

func (*Task) PurgeSnapshotStatus

func (t *Task) PurgeSnapshotStatus() (map[string]*SnapshotPurgeStatus, error)

func (*Task) PurgeSnapshots

func (t *Task) PurgeSnapshots(skip bool) error

func (*Task) RebuildStatus

func (t *Task) RebuildStatus() (map[string]*ReplicaRebuildStatus, error)

func (*Task) Reset

func (t *Task) Reset() error

func (*Task) RestoreBackup

func (t *Task) RestoreBackup(backup string, credential map[string]string) error

func (*Task) RestoreStatus

func (t *Task) RestoreStatus() (map[string]*RestoreStatus, error)

func (*Task) StartWithReplicas

func (t *Task) StartWithReplicas(replicas []string) error

func (*Task) VerifyRebuildReplica added in v1.1.0

func (t *Task) VerifyRebuildReplica(address string) error

type TaskError added in v1.0.1

type TaskError struct {
	ReplicaErrors []ReplicaError
}

func NewTaskError added in v1.0.1

func NewTaskError(res ...ReplicaError) *TaskError

func (*TaskError) Append added in v1.0.1

func (e *TaskError) Append(re ReplicaError)

func (*TaskError) Error added in v1.0.1

func (e *TaskError) Error() string

func (*TaskError) HasError added in v1.0.1

func (e *TaskError) HasError() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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