Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conf ¶
type Conf struct { User string `yaml:"user"` Password string `yaml:"password"` Host string `yaml:"host"` Port string `yaml:"port"` DatabaseName string `yaml:"database_name"` }
Conf is the configuration for the database.
type Database ¶
type Database interface { Connect() error Migrate() error Close() error Insert(ctx context.Context, query string, arguments ...interface{}) error BuildInsertQuery(table string, fields []string) string }
Database is the interface that wraps the basic database operations.
func NewDatabase ¶
func NewDatabase(databaseType DatabaseType) Database
NewDatabase returns a new database instance.
func NewTimescaleDB ¶
func NewTimescaleDB() Database
NewTimescaleDB returns a new instance of timescaleDB.
type DatabaseType ¶
type DatabaseType string
DatabaseType is the type of database.
const (
TimeScaleDB DatabaseType = "timescaledb"
)
Database types
Click to show internal directories.
Click to hide internal directories.