core

package
v0.0.0-...-f961e09 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Enforcer *casbin.Enforcer

Functions

func InitConfig

func InitConfig(configPath, configType, configToken, configKvPath, configRemoteType string)

InitConfig 初始化config

func InitGorm

func InitGorm() (*gorm.DB, map[string]*gorm.DB)

InitGorm 初始化 数据库 并 产生数据库全局变量

func InitRedisClient

func InitRedisClient() (*redis.Client, error)

InitRedisClient 初始化 redis

func InitZap

func InitZap()

InitZap 初始化Logger

Types

type Logger

type Logger struct {
	ZapLogger                 *zap.Logger
	LogLevel                  gormlogger.LogLevel
	SlowThreshold             time.Duration
	SkipCallerLookup          bool
	IgnoreRecordNotFoundError bool
}

Logger gorm使用zap作为logging

func (Logger) Error

func (l Logger) Error(ctx context.Context, str string, args ...interface{})

func (Logger) Info

func (l Logger) Info(ctx context.Context, str string, args ...interface{})

func (Logger) LogMode

func (l Logger) LogMode(level gormlogger.LogLevel) gormlogger.Interface

func (Logger) SetAsDefault

func (l Logger) SetAsDefault()

func (Logger) Trace

func (l Logger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

func (Logger) Warn

func (l Logger) Warn(ctx context.Context, str string, args ...interface{})

Jump to

Keyboard shortcuts

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