global

package
v1.0.7 Latest Latest
Warning

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

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

README

global

将初始化之后的组件注册到全局管理器中,之后在任意代码里面直接使用globa.*来调用对应的组件

避免了各种传递,版本不一致问题

global.Redis().XXX()
global.Myql().XXX()
global.Logger().XXX()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger() *logrus.Logger

func Mysql

func Mysql() *gorm.DB

func Redis

func Redis() *redis.Client

func RedisLock

func RedisLock() *redislock.Client

func SetLogger

func SetLogger(l *logrus.Logger)

func SetMysqlClient

func SetMysqlClient(r *gorm.DB)

func SetRedisClient

func SetRedisClient(r *redis.Client)

Types

This section is empty.

Jump to

Keyboard shortcuts

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