Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create initializes and opens a database for the specified type. The arguments are specific to the database type driver. See the documentation for the database driver for further details.
ErrDbUnknownType will be returned if the the database type is not registered.
func Open ¶
Open opens an existing database for the specified type. The arguments are specific to the database type driver. See the documentation for the database driver for further details.
ErrDbUnknownType will be returned if the the database type is not registered.
func RegisterDriver ¶
RegisterDriver adds a backend database driver to available interfaces. ErrDbTypeRegistered will be returned if the database type for the driver has already been registered.
func SupportedDrivers ¶
func SupportedDrivers() []string
SupportedDrivers returns a slice of strings that represent the database drivers that have been registered and are therefore supported.
Types ¶
type Driver ¶
type Driver struct { // DbType is the identifier used to uniquely identify a specific // database driver. There can be only one driver with the same name. DbType string // Create is the function that will be invoked with all user-specified // arguments to create the database. This function must return // ErrDbExists if the database already exists. Create func(args ...interface{}) (database.Database, error) // Open is the function that will be invoked with all user-specified // arguments to open the database. This function must return // ErrDbDoesNotExist if the database has not already been created. Open func(args ...interface{}) (database.Database, error) }
Driver defines a structure for backend drivers to use when they registered themselves as a backend which implements the DB interface.