dirver

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DebugMode indicates gin mode is debug.
	DebugMode = "debug"
	DbType    = "mysql"
)

Variables

View Source
var DB *gorm.DB

Functions

func InitializeDB

func InitializeDB(params LinkParams) (*gorm.DB, error)

InitializeDB 初始化管理后台数据库

func InitializeRedis

func InitializeRedis(config RedisConfig) *redis.Ring

InitializeRedis 链接Redis服务

Types

type LinkParams

type LinkParams struct {
	Host        string
	Port        int
	UserName    string
	DbName      string
	Password    string
	MaxOpenConn int
	MaxIdleConn int
	LogLevel    int
}

type Logger

type Logger struct {
}

func NewLogger

func NewLogger() *Logger

func (*Logger) Write

func (l *Logger) Write(p []byte) (n int, err error)

Write 实现Write接口,用于写入

type Redis

type Redis struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Password string `yaml:"password"`
}

Redis 配置

type RedisConfig

type RedisConfig struct {
	List map[string]Redis `yaml:"list"`
	Db   int              `yaml:"db"`
	TLS  int              `yaml:"tls"`
}

RedisConfig 配置

Jump to

Keyboard shortcuts

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