config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServerCfg = new(ServerConfig)

Functions

func Init

func Init(configPath string)

Init init global config

Types

type ServerConfig

type ServerConfig struct {
	ServerName string `yaml:"server_name"`
	Port       int    `yaml:"port"`
	DB         struct {
		Host     string `yaml:"host"`
		Port     int    `yaml:"port"`
		User     string `yaml:"user"`
		Password string `yaml:"password"`
		Dbname   string `yaml:"dbname"`
		MaxIdle  int    `yaml:"max_idle,omitempty"` //设置连接池中空闲连接的最大数量
		MaxOpen  int    `yaml:"max_open,omitempty"` //设置打开数据库连接的最大数量
	} `yaml:"db"`
	Redis struct {
		Host     string `yaml:"host"`
		Port     int    `yaml:"port"`
		Password string `yaml:"password"`
	} `yaml:"redis"`
}

Jump to

Keyboard shortcuts

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