db

package
v0.0.0-...-ed2f012 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BKDRHash

func BKDRHash(s string) int64

BKDR Hash Function

func Exit

func Exit()

Exit 在退出时调用

func FindIDCardSlot

func FindIDCardSlot(key string) *sql.DB

func FindPhoneSlot

func FindPhoneSlot(key string) *sql.DB

func FindTPUserIDSlot

func FindTPUserIDSlot(key string) *sql.DB

func FindUinSlot

func FindUinSlot(key int64) *sql.DB

func GetDB

func GetDB(dbName string) (db *sql.DB, err error)

根据数据库主机名获取DB对象(不存在的化,自动查找相关配置并创建)

func RowsInfo

func RowsInfo(rows *sql.Rows) (info string)

Types

type Config

type Config struct {
	LogLevel         int        `json:"log_level"`
	MaxOpenConn      int        `json:"max_open_conn"` // 最大连接池打开连接的数量
	MaxIdleConn      int        `json:"max_idle_conn"` // 最大连接池闲置连接数量
	DBUserInfos      []dbConfig `json:"db_user_infos"`
	DBIndexPhones    []dbConfig `json:"db_index_phones"`
	DBIndexTPUserIDs []dbConfig `json:"db_index_third_platform_userid"`
	DBIndexIDCards   []dbConfig `json:"db_index_id_card"`
}

func (*Config) PostInit

func (c *Config) PostInit()

func (*Config) PostUpdate

func (c *Config) PostUpdate(cfg interface{})

Jump to

Keyboard shortcuts

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