cfg

package
v0.0.0-...-1115455 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(envPrefix string, cfgFile string, opts ...viper.DecoderConfigOption) error

Types

type Config

type Config struct {
	Sys       SysConfig
	MainLog   LogConfig
	AccessLog httpx.LogConfig
}

func Get

func Get() *Config

func (*Config) String

func (c *Config) String() string

type LogConfig

type LogConfig struct {
	LogFile log.FileConfig
	Level   string `vx_default:"info"`
}

type SysConfig

type SysConfig struct {
	ConfigFile        string `vx_name:"conf" vx_short:"c"`
	Port              string `vx_name:"port" vx_short:"p" vx_default:"8080" vx_desc:"port to listen on"`
	Address           string `vx_name:"address" vx_short:"a" vx_default:"127.0.0.1" vx_desc:"address to listen on"`
	ProfilePort       int    `vx_default:"16060"`
	MaxUploadParallel int    `vx_default:"100"`
	Domain            string `vx_must:"true"`
	Root              string `vx_must:"true"`

	DiskReservePercent string `vx_default:"-"` //   -: 遵从磁盘预留空间设置; 整数:预留百分比

}

Jump to

Keyboard shortcuts

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