global

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Glog *zap.Logger
View Source
var Mysql *gorm.DB
View Source
var Object *obj

Object 定义一个全局的对象

View Source
var Redis *redis.Client

Functions

func CustomTimeEncoder

func CustomTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)

CustomTimeEncoder 自定义日志输出时间格式

func GetWriteSyncer

func GetWriteSyncer() (zapcore.WriteSyncer, error)

func InitGormMysql added in v1.1.0

func InitGormMysql() *gorm.DB

InitGormMysql 只读数据库连接

func InitObject added in v1.0.1

func InitObject()

InitObject 初始化全局配置

func InitRedis

func InitRedis()

func InitZap added in v1.0.1

func InitZap()

func PathExists

func PathExists(path string) (bool, error)

PathExists 判断一个文件是否存在

Types

This section is empty.

Jump to

Keyboard shortcuts

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