lib

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: MIT Imports: 13 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 NewNullInt64 added in v1.0.3

func NewNullInt64(s int64) sql.NullInt64

NewNullInt64

func NewNullString added in v1.0.3

func NewNullString(s string) sql.NullString

NewNullString

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 // 分钟
	LogLevel     logger.LogLevel
}

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