dbconn

package
v0.0.0-...-f657c13 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDBConn

func InitDBConn()

InitDBConn initiate the DB connection singleton object with global configs

It is safe to call this method multiple times incidentally.

Types

type DBConnStore

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

func GetDBConn

func GetDBConn() *DBConnStore

GetDBConn Get the singleton DB connection store object

func (*DBConnStore) AdaptTableName

func (db *DBConnStore) AdaptTableName(tableObj interface{}) string

AdaptTableName returns the table name based on current global db config and orm engine config. Add prefixs and split words.

func (*DBConnStore) AssureTables

func (db *DBConnStore) AssureTables(dataModels ...interface{}) error

func (*DBConnStore) GetGOrmEngine

func (db *DBConnStore) GetGOrmEngine() *gorm.DB

func (*DBConnStore) GetOriginalGoSqlDB

func (db *DBConnStore) GetOriginalGoSqlDB() *sql.DB

type EtcdConnStore

type EtcdConnStore struct {
	ServerEndpoints []string
	// contains filtered or unexported fields
}

func MustGetEtcdConn

func MustGetEtcdConn() *EtcdConnStore

MustGetEtcdConn returns the singleton instance of EtcdConnStore

func NewETCDConnStoreWithGlobalConfig

func NewETCDConnStoreWithGlobalConfig() (*EtcdConnStore, error)

func (*EtcdConnStore) GetClient

func (e *EtcdConnStore) GetClient() *clientv3.Client

Jump to

Keyboard shortcuts

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