Documentation
¶
Overview ¶
Package boltdb contains the boltdb implementations of the DAX interfaces.
Index ¶
Constants ¶
const (
ErrFmtBucketNotFound = "boltdb: bucket '%s' not found"
)
Variables ¶
var DirectiveBuckets []Bucket = []Bucket{
bucketDirective,
}
DirectiveBuckets defines the buckets used by this package. It can be called during setup to create the buckets ahead of time.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// Datasource name.
DSN string
// Returns the current time. Defaults to time.Now().
// Can be mocked for tests.
Now func() time.Time
// contains filtered or unexported fields
}
DB represents the database connection.
func NewSvcBolt ¶
NewSvcBolt gets, opens, and creates buckets for a boltDB for a particular named service (the data file will be named after the service).
func (*DB) BeginTx ¶
BeginTx starts a transaction and returns a wrapper Tx type. This type provides a reference to the database and a fixed timestamp at the start of the transaction. The timestamp allows us to mock time during tests as well. The wrapper also contains the context.
func (*DB) InitializeBuckets ¶
InitializeBuckets creates the given buckets if they do not already exist.
func (*DB) RegisterBuckets ¶
RegisterBuckets queues up the buckets to be created when the database is first opened.
type DirectiveVersion ¶
type DirectiveVersion struct {
// contains filtered or unexported fields
}
func NewDirectiveVersion ¶
func NewDirectiveVersion(db *DB) *DirectiveVersion
func (*DirectiveVersion) Increment ¶
func (d *DirectiveVersion) Increment(tx dax.Transaction, delta uint64) (uint64, error)