Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is an implementation of fab.HashDB that uses a Sqlite3 file for persistent storage.
func Open ¶
Open opens the given file and returns it as a *DB. The file is created if it doesn't already exist. The database schema is created in the file if needed. Callers should call Close when finished operating on the database.
type Option ¶
type Option func(*DB)
Option is the type of a config option that can be passed to Open.
func Keep ¶
Keep is an Option that sets the amount of time to keep a database entry. By default, DB keeps all entries. Using Keep(d) allows DB to evict entries whose last-access time is older than d.
func UpdateOnAccess ¶ added in v0.7.0
UpdateOnAccess is an Option controlling whether to update a db entry's timestamp when accessed with Has. The default is true: each Has of a value refreshes its timestamp to prevent its expiration.