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
Click to show internal directories.
Click to hide internal directories.