initialize

package
v0.0.0-...-c676f21 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Casbin

func Casbin(dbIns *gorm.DB, box *config.CustomConfBox, conf *config.Configuration) *casbin.Enforcer

Casbin 初始化casbin

func Config

func Config(developmentConfig string, productionConfig string) (*config.CustomConfBox, *config.Configuration)

初始化配置文件 参数1: 默认开发配置文件 参数2: 默认生产配置文件

func InitLogger

func InitLogger(conf *config.Configuration) *logger.GormZapLogger

InitLogger 初始化日志,使用zap+lumberjack代替标准库的log

func MySQL

func MySQL(opt *config.MysqlConfiguration, log gormlogger.Interface, models ...interface{}) *gorm.DB

MySQL model为表结构

func Redis

func Redis(redisConf *config.RedisConfiguration) *redis.Client

Redis 初始化Redis

func ZapLogLocalTimeEncoder

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

zap日志自定义时间格式

Types

This section is empty.

Jump to

Keyboard shortcuts

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