lib

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMysql

func NewMysql(config DatabaseConfig) (*gorm.DB, error)

NewMysql 数据库连接

func NewRedis

func NewRedis(config RedisConfig) (*redis.Client, error)

NewRedis redis连接

Types

type DatabaseConfig

type DatabaseConfig struct {
	Host         string
	Port         string
	User         string
	Pass         string
	DbName       string
	Prefix       string
	MaxIdleConns int
	MaxOpenConns int
	MaxLifeTime  int // 分钟
}

type Logger

type Logger struct {
	*logrus.Logger
}

func NewLogger

func NewLogger(logPath, module string, debug bool) (*Logger, error)

NewLogger 构造日志服务

type RedisConfig

type RedisConfig struct {
	Addr     string
	Password string
	DbNum    int
}

Jump to

Keyboard shortcuts

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