Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶ added in v0.34.0
type DB struct {
// contains filtered or unexported fields
}
DB gates transactions so compaction can replace the underlying handle.
func SafeOpen ¶ added in v0.27.0
func SafeOpen(dbPath string, mode os.FileMode, opts *bolt.Options, policies ...compaction.Config) (*DB, error)
SafeOpen opens a bolt database with automatic recovery from corruption. If the database file is corrupted, it backs up the corrupted file and creates a new empty database. This is useful for disposable databases like cache or history where data loss is acceptable but startup failure is not.
func (*DB) Compact ¶ added in v0.34.0
func (d *DB) Compact(ctx context.Context, opt db.CompactOptions) (db.CompactResult, error)
Compact pauses transactions while copying live data to a replacement file. It requires enough free disk space to hold both files until replacement.
func (*DB) CompactionStats ¶ added in v0.34.0
func (d *DB) CompactionStats() (db.CompactionStats, error)
Click to show internal directories.
Click to hide internal directories.