lib

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

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 CloseDB

func CloseDB() error

func Destroy

func Destroy()
 =================================================================
	整个APP执行结束 回调的函数
	主要用于 关闭 数据连接 日志文件流关闭
 * =================================================================

func GenMd5Err

func GenMd5Err(data string) (string, error)

带返回报错

func GenMd5Str

func GenMd5Str(text string) string
 =================================================================
	MD5加密
 * =================================================================

func GetDBPool

func GetDBPool(name string) (*sql.DB, error)

func GetGormPool

func GetGormPool(name string) (*gorm.DB, error)

func GetLocalIPs

func GetLocalIPs() (ips []net.IP)
 =================================================================
	获取本地IP地址 除去回环地址
 * =================================================================

func InitCore

func InitCore(configDirPath string, modules []string) error
 =================================================================
	模块初始化 配置
	eg: core.InitCore("./conf/dev/",[]string{"base", "mysql", "redis"})
 * =================================================================

func InitDbPool

func InitDbPool(path string) error
 =================================================================
	数据库系列 二次封装工具
 * =================================================================

func IsStrInArray

func IsStrInArray(target string, arr []string) bool
 =================================================================
	判断字符串 是否在 字符数组中
 * =================================================================

func RedisConfDo

func RedisConfDo(name string, commandName string, args ...interface{}) (interface{}, error)

通过配置 执行redis

func RedisConnFactory

func RedisConnFactory(name string) (redis.Conn, error)
 =================================================================
	redis 初始化操作
 * =================================================================

func Substr

func Substr(str string, start int64, end int64) string
 =================================================================
	Substr 字符串的截取
 * =================================================================

Types

type MysqlGormLogger

type MysqlGormLogger struct {
	gorm.Logger
}

mysql日志打印类

Jump to

Keyboard shortcuts

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