Documentation ¶
Index ¶
- Variables
- type ConsulDB
- func (c *ConsulDB) CheckDatabase() error
- func (c *ConsulDB) CreateEntry(key string, value string) error
- func (c *ConsulDB) DeleteEntry(key string) error
- func (c *ConsulDB) InitializeDatabase() error
- func (c *ConsulDB) ReadAll(prefix string) ([]string, error)
- func (c *ConsulDB) ReadEntry(key string) (string, bool, error)
- type DatabaseConnection
Constants ¶
This section is empty.
Variables ¶
View Source
var CreateDBClient = func(dbType string) error { if dbType == "consul" { DBconn = &ConsulDB{} return nil } return pkgerrors.New("No suitable DB found") }
CreateDBClient creates the DB client
Functions ¶
This section is empty.
Types ¶
type ConsulDB ¶
type ConsulDB struct {
// contains filtered or unexported fields
}
ConsulDB is an implementation of the DatabaseConnection interface
func (*ConsulDB) CheckDatabase ¶
CheckDatabase checks if the database is running
func (*ConsulDB) CreateEntry ¶
CreateEntry is used to create a DB entry
func (*ConsulDB) DeleteEntry ¶
DeleteEntry is used to delete an ID
func (*ConsulDB) InitializeDatabase ¶
InitializeDatabase initialized the initial steps
type DatabaseConnection ¶
type DatabaseConnection interface { InitializeDatabase() error CheckDatabase() error CreateEntry(string, string) error ReadEntry(string) (string, bool, error) DeleteEntry(string) error ReadAll(string) ([]string, error) }
DatabaseConnection is an interface for accessing a database
var DBconn DatabaseConnection
DBconn interface used to talk a concrete Database connection
Click to show internal directories.
Click to hide internal directories.