database

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

Variables

This section is empty.

Functions

This section is empty.

Types

type DBType

type DBType = dbdriver.Engine

DBType identifies the database engine (alias of driver.Engine for legacy callers).

type Database

type Database struct {
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase(conf *config.DatabaseConfig, dbType DBType, queryTimeout int, log *nlog.Log) *Database

NewDatabase creates the new database tuple.

func (*Database) Driver added in v0.2.0

func (d *Database) Driver() Driver

Driver returns the HA database facade (preferred for new code).

func (*Database) GetMysql

func (d *Database) GetMysql() *mysql.Mysql

GetMysql returns the MySQL handle. Deprecated: use Driver(); retained for raft/RPC migration.

func (*Database) GetPostgreSQL

func (d *Database) GetPostgreSQL() *postgresql.Postgresql

func (*Database) SetupDB

func (d *Database) SetupDB()

SetupDB used to create database

func (*Database) Start

func (d *Database) Start()

func (*Database) Stop

func (d *Database) Stop()

type Driver added in v0.2.0

type Driver = dbdriver.Driver

Driver re-exports the HA database interface.

Directories

Path Synopsis
Package driver defines the L4 database abstraction for HA orchestration.
Package driver defines the L4 database abstraction for HA orchestration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL