global

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ServerConfig Config
	Logger       *zap.Logger
	EasterDB     *gorm.DB
)

Functions

func InitConfig

func InitConfig(env string)

func InitDB

func InitDB()

func InitLogger

func InitLogger()

func Initialize

func Initialize(env string)

func LoggerMiddleware

func LoggerMiddleware(logger *zap.Logger) gin.HandlerFunc

LoggerMiddleware for request

func RecoveryMiddleware

func RecoveryMiddleware(logger *zap.Logger, stack bool) gin.HandlerFunc

Types

type Config

type Config struct {
	Db  MysqlConfig `yaml:"db"`
	Log LogConfig   `yaml:"log"`
}

type LogConfig

type LogConfig struct {
	Path  string `yaml:"path"`
	File  string `yaml:"file"`
	Level string `yaml:"level"`
}

type MysqlConfig

type MysqlConfig struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Password string `yaml:"password"`
	Database string `yaml:"database"`
	Username string `yaml:"username"`
	Charset  string `yaml:"charset"`
}

Jump to

Keyboard shortcuts

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