Documentation
¶
Index ¶
- Variables
- func CloseDB() error
- func Destroy()
- func GenMd5Err(data string) (string, error)
- func GenMd5Str(text string) string
- func GetDBPool(name string) (*sql.DB, error)
- func GetGormPool(name string) (*gorm.DB, error)
- func GetLocalIPs() (ips []net.IP)
- func InitCore(configDirPath string, modules []string) error
- func InitDbPool(path string) error
- func IsStrInArray(target string, arr []string) bool
- func RedisConfDo(name string, commandName string, args ...interface{}) (interface{}, error)
- func RedisConnFactory(name string) (redis.Conn, error)
- func Substr(str string, start int64, end int64) string
- type MysqlGormLogger
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TimeFormat = "2006-01-02 15:04:05" DateFormat = "2006-01-02" )
View Source
var DBDefaultPool *sql.DB
View Source
var DBMapPool map[string]*sql.DB
View Source
var GORMDefaultPool *gorm.DB
View Source
var GORMMapPool map[string]*gorm.DB
Functions ¶
func Destroy ¶
func Destroy()
================================================================= 整个APP执行结束 回调的函数 主要用于 关闭 数据连接 日志文件流关闭 * =================================================================
func GenMd5Str ¶
================================================================= MD5加密 * =================================================================
func GetLocalIPs ¶
================================================================= 获取本地IP地址 除去回环地址 * =================================================================
func InitCore ¶
================================================================= 模块初始化 配置 eg: core.InitCore("./conf/dev/",[]string{"base", "mysql", "redis"}) * =================================================================
func InitDbPool ¶
================================================================= 数据库系列 二次封装工具 * =================================================================
func IsStrInArray ¶
================================================================= 判断字符串 是否在 字符数组中 * =================================================================
func RedisConfDo ¶
通过配置 执行redis
func RedisConnFactory ¶
================================================================= redis 初始化操作 * =================================================================
Types ¶
Click to show internal directories.
Click to hide internal directories.