config

package
v0.0.0-...-0c6732d Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DatabaseEngineInMemory = "inmemory"
	DatabaseEngineMySQL    = "mysql"

	CacheEngineInMemory = "inmemory"
	CacheEngineRedis    = "redis"
)
View Source
const (
	LogFormatJSON = "json"
	LogFormatText = "text"

	LogLevelError = "error"
	LogLevelInfo  = "info"
	LogLevelDebug = "debug"
)

Variables

View Source
var (
	Conf *config
)
View Source
var (
	MySQLConn *gorm.DB
)
View Source
var (
	RedisConn *redis.Client
)

Functions

func InitConf

func InitConf(confPath string)

func InitLog

func InitLog()

func InitMySQLConn

func InitMySQLConn()

func InitRedisConn

func InitRedisConn()

Types

type CustomValidator

type CustomValidator interface {
	Validate(validate *validator.Validate) error
}

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

func GetValidator

func GetValidator() *Validator

func (*Validator) Validate

func (v *Validator) Validate(i any) error

Jump to

Keyboard shortcuts

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