Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeForTableName ¶ added in v0.4.0
func Unversioned ¶
func Unversioned(store driver.VersionedPersistence) driver.UnversionedPersistence
Unversioned returns the unversioned persistence from the supplied versioned one
Types ¶
type Config ¶
type Config interface { // IsSet checks to see if the key has been set in any of the data locations IsSet(key string) bool // UnmarshalKey takes a single key and unmarshals it into a Struct UnmarshalKey(key string, rawVal interface{}) error }
Config models the DB configuration
type PrefixConfig ¶
type PrefixConfig struct {
// contains filtered or unexported fields
}
PrefixConfig extends Config by adding a given prefix to any passed key
func NewPrefixConfig ¶
func NewPrefixConfig(config Config, prefix string) *PrefixConfig
NewPrefixConfig returns a ner PrefixConfig instance for the passed prefix
func (*PrefixConfig) IsSet ¶ added in v0.3.0
func (c *PrefixConfig) IsSet(key string) bool
IsSet checks to see if the key has been set in any of the data locations
func (*PrefixConfig) UnmarshalKey ¶
func (c *PrefixConfig) UnmarshalKey(key string, rawVal interface{}) error
UnmarshalKey takes a single key, appends to it the prefix set in the struct, and unmarshals it into a Struct
type TransactionalUnversionedPersistence ¶ added in v0.4.0
type TransactionalUnversionedPersistence struct {
driver.TransactionalUnversionedPersistence
}
func OpenTransactional ¶ added in v0.4.0
type TransactionalVersionedPersistence ¶ added in v0.4.0
type TransactionalVersionedPersistence struct {
driver.TransactionalVersionedPersistence
}
type UnversionedPersistence ¶ added in v0.4.0
type UnversionedPersistence struct {
driver.UnversionedPersistence
}
func Open ¶
func Open(driver driver.Driver, dataSourceName string, config Config) (*UnversionedPersistence, error)
Open returns a new persistence handle. Similarly to database/sql: driverName is a string that describes the driver dataSourceName describes the data source in a driver-specific format. The returned connection is only used by one goroutine at a time.
type VersionedPersistence ¶ added in v0.4.0
type VersionedPersistence struct {
driver.VersionedPersistence
}
func OpenVersioned ¶
func OpenVersioned(driver driver.Driver, dataSourceName string, config Config) (*VersionedPersistence, error)
OpenVersioned returns a new *versioned* persistence handle. Similarly to database/sql: driverName is a string that describes the driver dataSourceName describes the data source in a driver-specific format. The returned connection is only used by one goroutine at a time.
Directories ¶
Path | Synopsis |
---|---|
badger/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
unversioned/mocks
Code generated by counterfeiter.
|
Code generated by counterfeiter. |