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

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