Documentation
¶
Overview ¶
Package lifecycle manages graceful shutdown with auto-save of session state, cache flush, and database closure.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ShredBoltDB ¶
ShredBoltDB shreds a BoltDB database (4096-byte meta pages).
func ShredDatabase ¶
ShredDatabase irreversibly destroys a database file by overwriting its header with random bytes, making it unreadable without backup.
For SQLite: overwrites first 100 bytes (header with magic bytes "SQLite format 3\000"). For BoltDB: overwrites first 4096 bytes (two 4KB meta pages).
WARNING: This operation is IRREVERSIBLE. Data is only recoverable from peer backup.
func ShredSQLite ¶
ShredSQLite shreds a SQLite database (100-byte header).
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager orchestrates graceful shutdown of all resources.
func NewManager ¶
NewManager creates a new lifecycle Manager. Timeout is the maximum time allowed for all shutdown hooks to complete.
func (*Manager) OnShutdown ¶
OnShutdown registers a shutdown hook. Hooks are called in LIFO order (last registered = first called), matching defer semantics.