Documentation ¶
Overview ¶
Package db implements interfaces to different database types and provides specification of BlockstackDB and DB operations, such that any new database can be used as long as it implements those methods.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockstackDB ¶
type BlockstackDB interface { DB GetNames() (map[string]map[string]bool, error) GetNamesAt(t time.Time) (map[string]map[string]bool, error) PutNames(names map[string]map[string]bool) error PutNamesAt(names map[string]map[string]bool, t time.Time) error }
BlockstackDB provides interface for Blockstack related operations
func New ¶
func New() (BlockstackDB, error)
New attempts to instantiate a new database instance using the configuration variables provided.
func NewBadgerDB ¶
func NewBadgerDB(path string) (BlockstackDB, error)
NewBadgerDB instantiates and returns a Badger DB instance based on the provided path. If one or more directories don't exist, it will attempt to create them, and returns an error if any occur.
func NewBoltDB ¶
func NewBoltDB(path string) (BlockstackDB, error)
NewBoltDB instantiates and returns a Bolt DB instance based on the provided path. If one or more directories don't exist, it will attempt to create them, and returns an error if any occur.
Directories ¶
Path | Synopsis |
---|---|
package badger implements database operations for BadgerDB
|
package badger implements database operations for BadgerDB |
package bolt implements operations using Bolt as the underlying database
|
package bolt implements operations using Bolt as the underlying database |