config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MulanPSL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MysqlDefaultMaxIdle     = 10
	MysqlDefaultMaxActive   = 100
	MysqlDefaultIdleTimeout = 3600
	MysqlDefaultDsn         = "root:@tcp(127.0.0.1:3307)/crh?charset=utf8mb4&parseTime=true&loc=Local"
)
View Source
var App = &AppConf{
	Addr:         "8080",
	ReadTimeout:  30,
	WriteTimeout: 30,
	Mode:         "release",
	Env:          "dev",
}

App app config

View Source
var Custom = &customConf{}
View Source
var Log = &LogConf{}

Functions

This section is empty.

Types

type AppConf

type AppConf struct {
	Addr         string
	ReadTimeout  int
	WriteTimeout int
	Mode         string
	DbMode       bool
	Env          string
	IsDevMode    bool
}

AppConf APP结构体

type LogConf

type LogConf struct {
	LogLevel     string
	LogFormatter string
}

type MysqlConf

type MysqlConf struct {
	MaxIdle     int
	MaxActive   int
	IdleTimeout int
	Dsn         string
}

MysqlConf mysql配置模板

func GetMysqlConf

func GetMysqlConf(tag string) *MysqlConf

GetMysqlConf 获取mysql配置

type RedisConf

type RedisConf struct {
	MasterName    string
	SentinelAddrs []string
	Password      string
	DB            int
	ReadTimeout   time.Duration
	WriteTimeout  time.Duration
	IdleTimeout   time.Duration
	Addr          string
	IsSentinel    bool
}

func GetRedisConf

func GetRedisConf(tag string) *RedisConf

GetRedisConf get redis conf

Jump to

Keyboard shortcuts

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