Documentation
¶
Overview ¶
Package singleuser turns a database that grew several users into one with a single owner. Run is called once at startup, after every store has created its tables: it keeps the oldest registered user, copies the database aside, and deletes every other user with all their data in one transaction.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteMarker ¶
WriteMarker records that the cleanup is settled for this database. Run calls it after deleting; the first passkey registration on an instance calls it too, because such an instance never held several users from before the upgrade, and a user invited later must survive a restart.
Types ¶
type Result ¶
type Result struct {
// Ran is true when a cleanup was recorded this start.
Ran bool
// Kept is the username of the user the instance kept.
Kept string
// Removed is how many other users were deleted.
Removed int
// BackupPath is the copy taken before deleting, empty when none was needed.
BackupPath string
}
Result says what Run did.
Click to show internal directories.
Click to hide internal directories.