Documentation
¶
Overview ¶
Package rpc is the backup module as another module sees it (docs/decisions/0071): the status of the backups, the list of what the archive holds, and a backup now, as methods of the `backup` module over internal/modcall. The restore function's methods are its own (U26).
Index ¶
Constants ¶
const ( RestoreModule = "restore" MethodRestoreStatus = "status" )
The restore function's module and method. It is the same zip as the backup module's, deployed a second time (docs/decisions/0072), and answers one call: the console and the administrator's tools read how the restore stands. Nothing here starts, resumes or previews a restore: that is an invocation of the function itself, which only an administrator or the break-glass role may make (internal/lambdaapp).
const ( Module = "backup" MethodStatus = "status" MethodList = "list" MethodRun = "run" )
Module is the name of the module and the methods it answers.
const ( CallerConsole = "console" CallerAdmin = "admin" CallerBreakglass = "breakglass" )
Caller classes (the alias a call arrives through, `live-<class>`): the console shows the status and the list; an administrator or the break-glass role also starts a backup. The console has no button for a restore, and none to start a backup.
const DefaultTokenFile = "/var/run/secrets/sluis/backup/token"
DefaultTokenFile is where the pod's projected token for the backup module is mounted when the document does not say.
Variables ¶
This section is empty.
Functions ¶
func RegisterRestore ¶
func RegisterRestore(s *modcall.Server, svc RestoreService)
RegisterRestore makes svc answer `restore.status` on s: the console, an administrator and the break-glass role may read it, and no caller may do more.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the read side of the backup and restore modules, as the console calls them: through a modcall.Caller whose transport says the caller class is `console`. It has no method that starts a backup or touches a restore, because the modules do not let that class do either.
func Dial ¶
Dial is the Client of the modules `console.backup` names, called as the caller class `console`: each module's Lambda function (its `live-console` alias) or Kubernetes Service. A restore target left out is a module the router cannot reach, which the page shows as a restore function it has none of.
func (*Client) RestoreStatus ¶
RestoreStatus is `restore.status`.
type ListRequest ¶
type ListRequest struct {
Limit int `json:"limit,omitempty"`
}
ListRequest asks for the newest Limit backups; 0 is all.
type ListResponse ¶
ListResponse is `backup.list`.
type RestoreService ¶
type RestoreService interface {
RestoreStatus(ctx context.Context) (restorejob.Status, error)
}
RestoreService is what the restore methods call. *App of internal/backup/app is one.
type RunRequest ¶
type RunRequest struct {
Resume bool `json:"resume,omitempty"`
}
RunRequest starts a backup, or with Resume only continues a paused one.