Documentation
¶
Overview ¶
Package dr keeps every kind of data backed up to the recovery storage (Phase 29b): it turns protection on where it is missing, one change at a time, and reports what is protected and what is at risk.
Index ¶
Constants ¶
const ( StateProtected = "protected" StateAtRisk = "at-risk" StateNotNeeded = "not-needed" )
States of an item.
const Actor = "syncloud"
Actor is who makes the changes this package starts.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backups ¶
type Backups interface {
Recovery() (backup.Storage, bool)
Config() (backup.Config, bool)
Status() backup.Status
Standby() (reason string, held bool)
}
Backups is the controller's backups.
type Databases ¶
type Databases interface {
ProtectionItems(ctx context.Context) []Item
UnprotectedIDs(ctx context.Context) []string
Protect(ctx context.Context, id string) error
Rolling(ctx context.Context) bool
}
Databases are the managed databases.
type Item ¶
type Item struct {
Kind string `json:"kind"` // controller | postgres | valkey | gitserver | registry
ID string `json:"id,omitempty"`
Name string `json:"name"`
Owner string `json:"owner,omitempty"` // project/environment of a database
State string `json:"state"`
Reason string `json:"reason,omitempty"`
Location string `json:"location,omitempty"`
LastBackup *time.Time `json:"lastBackup,omitempty"`
}
Item is one thing that holds data.
type Manager ¶
type Manager struct {
// Hold reports whether a kind of work waits for a recovery (Phase 29c);
// may be nil.
Hold func(kind string) bool
// NodeAddresses lists the nodes' public addresses (storage on them is
// inside the cluster).
NodeAddresses func(ctx context.Context) []string
// contains filtered or unexported fields
}
type Registry ¶
type Registry interface {
Status(ctx context.Context) regstorage.Status
Start(ctx context.Context, to regstorage.Target, actor string) (regstorage.Status, error)
}
Registry is where the registry keeps its images.