Documentation ¶
Overview ¶
Package store defines the permanent storage service.
Index ¶
Constants ¶
const ( DirScoreDecay = 0.986 // roughly 0.5^(1/50) DirScoreIncrement = 10 DirScorePrecision = 6 )
Parameters for directory history scores.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBStore ¶
type DBStore interface {
Store
Close() error
}
DBStore is the permanent storage backend for elvish. It is not thread-safe. In particular, the store may be closed while another goroutine is still accessing the store. To prevent bad things from happening, every time the main goroutine spawns a new goroutine to operate on the store, it should call wg.Add(1) in the main goroutine before spawning another goroutine, and call wg.Done() in the spawned goroutine after the operation is finished.
func MustTempStore ¶
MustTempStore returns a Store backed by a temporary file for testing. The Store and its underlying file will be cleaned up properly after the test is finished.