Documentation
¶
Overview ¶
Package backupstore manages Mooring's own-state backups: a consistent snapshot of the SQLite database (via VACUUM INTO), AES-256-GCM-encrypted with the master key (the chunked, tamper-evident stream from internal/backup), written under the data dir and recorded in a catalog. This is the "recover Mooring onto a fresh box" backup — it carries every app's config, definitions, edge routes, and (already- encrypted) secrets. App-internal data volumes are a separate snapshot type.
Index ¶
- type Record
- type Store
- func (s *Store) Available() bool
- func (s *Store) Create(ctx context.Context, now time.Time) (Record, error)
- func (s *Store) Delete(ctx context.Context, id string) error
- func (s *Store) FilePath(r Record) string
- func (s *Store) Get(ctx context.Context, id string) (Record, bool, error)
- func (s *Store) List(ctx context.Context) ([]Record, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Record ¶
type Record struct {
ID string
CreatedAt int64
SizeBytes int64
File string
SHA256 string
Kind string
Note string
}
Record is one catalogued backup.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store creates, lists, and deletes encrypted state backups.
func (*Store) Available ¶
Available reports whether backups can be taken (a valid key is configured).
func (*Store) Create ¶
Create takes a consistent snapshot of the DB, encrypts it, and records it. The plaintext snapshot exists only transiently (0600, in the 0700 backups dir) and is removed as soon as it's encrypted.
func (*Store) FilePath ¶
FilePath returns the absolute path of a record's archive, confined to the backups dir (the stored file name is always a generated <id>.mbk, never user input).