config

package
v0.0.0-...-479da69 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var C = &Config{}

C 全局配置变量

Functions

func ParseConfig

func ParseConfig(cfgPath string)

ParseConfig 解析配置

Types

type Config

type Config struct {
	Debug      bool           `yaml:"debug" toml:"debug" json:"debug"`                   //是否是调试模式
	Logger     logger.Conf    `yaml:"logger" toml:"logger" json:"logger"`                //日志
	DB         db.Conf        `yaml:"db" toml:"db" json:"db"`                            //数据库配置
	Redis      redis.Conf     `yaml:"redis" toml:"redis" json:"redis"`                   //redis配置
	JWT        jwt.Conf       `yaml:"jwt" toml:"jwt" json:"jwt"`                         //jwt配置
	HttpServer HttpServerConf `yaml:"http_server" toml:"http_server" json:"http_server"` //http服务配置
}

Config 整体的配置信息

type HttpServerConf

type HttpServerConf struct {
	Addr string `yaml:"addr" toml:"addr" json:"addr" default:":8080"` //监听地址
}

HttpServerConf http服务配置

Jump to

Keyboard shortcuts

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