Documentation
¶
Index ¶
- Variables
- func Checks(dir string, opened capsule.Manifest) []recoveryclient.Check
- func Collect(ctx context.Context, cfg *config.Config, appVersion string) (recoveryclient.Payload, error)
- func DrillRoot(cfg *config.Config) string
- func Members(cfg *config.Config, managed bool) []string
- func NewSealer(cfg *config.Config) (recoveryclient.Sealer, error)
- func RunConfig(cfg *config.Config, appVersion string) (recoveryclient.RunConfig, error)
- func RunDrill(ctx context.Context, cfg *config.Config, payload recoveryclient.Payload) (*recoveryclient.DrillResult, error)
- func Settings(ctx context.Context, s store.SettingsStore) recoveryclient.Settings
Constants ¶
This section is empty.
Variables ¶
var ErrDrillBusy = errors.New("backup: a restore drill is already running")
var ErrNoDatabaseSnapshot = errors.New("backup: no consistent database snapshot for this driver")
ErrNoDatabaseSnapshot is returned when the payload cannot carry a consistent copy of the database, so a capsule without one is never sealed as if it were a backup.
Functions ¶
func Checks ¶
func Checks(dir string, opened capsule.Manifest) []recoveryclient.Check
Checks validates the recipe from the capsule that was actually opened. A malformed recipe is a failed drill, never permission to omit a required product check.
func Collect ¶
func Collect(ctx context.Context, cfg *config.Config, appVersion string) (recoveryclient.Payload, error)
Collect assembles the payload every sealing caller uses: the local application files (SQLite database, configuration) plus the members that may only ever travel inside a sealed capsule (the encryption key, the pinned recovery public key). Nothing that returns from here may leave the process except through a Sealer.
func Members ¶
Members names what a capsule carries, for the screen; it is what Collect would seal now.
func NewSealer ¶
func NewSealer(cfg *config.Config) (recoveryclient.Sealer, error)
NewSealer seals the KyRecovery token under the deployment key, domain-separated so a row copied from another setting will not open.
func RunDrill ¶
func RunDrill(ctx context.Context, cfg *config.Config, payload recoveryclient.Payload) (*recoveryclient.DrillResult, error)
RunDrill serializes HTTP and CLI drills sharing a data directory. The persistent lock file must not be unlinked: all processes must lock the same inode. Closing the descriptor (including process exit) releases the advisory lock.
func Settings ¶
func Settings(ctx context.Context, s store.SettingsStore) recoveryclient.Settings
Settings binds the request context to the settings store for one call into the lib.
Types ¶
This section is empty.