config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load()

Load 导入配置和参数

Types

type AppConfig

type AppConfig struct {
	Server *ServerConfig `yaml:"server"`
	MySQL  *MySQLConfig  `yaml:"mysql"`
	Redis  *RedisConfig  `yaml:"redis"`
}
var AppCfg *AppConfig

type MySQLConfig

type MySQLConfig struct {
	Host        string `yaml:"host"`
	Port        int    `yaml:"port"`
	User        string `yaml:"user"`
	Pass        string `yaml:"pass"`
	Name        string `yaml:"name"`
	MaxOpen     int    `yaml:"max-open"`
	MaxIdle     int    `yaml:"max-idle"`
	MaxLifeTime int    `yaml:"max-life-time"`
	MaxIdleTime int    `yaml:"max-idle-time"`
}

type RedisConfig

type RedisConfig struct {
	Addr        string `yaml:"addr"`
	Pass        string `yaml:"pass"`
	Db          int    `yaml:"db"`
	MaxConn     int    `yaml:"max-conn"`
	MinIdle     int    `yaml:"min-idle"`
	DialTimeout int    `yaml:"dial-timeout"`
	IdleTimeout int    `yaml:"idle-timeout"`
	MaxRetries  int    `yaml:"max-retries"`
	MaxConnAge  int    `yaml:"max-conn-age"`
}

type ServerConfig

type ServerConfig struct {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
}

Jump to

Keyboard shortcuts

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