rootconf

package
v0.10.16 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicConfig

type BasicConfig struct {
	// 模块名
	Name string `flag:"name:name;usage:模块名;env:APP_NAME"`
	// environment
	Env string `flag:"name:env;short:e;default:dev;usage:环境;env:ENV"`
}

BasicConfig

type EnvConfig

type EnvConfig struct {
	Debug             bool   `flag:"name:debug;short:d;default:true;usage:是否测试;env:DEBUG"`
	ConfigTemplateDir string `flag:"name:conf_tmpl_dir;usage:是否生成配置模板;env:CONFIG_TEMPLATE_DIR"`
	// 代理, socks5://localhost:1080
	Proxy       string `flag:"name:proxy;usage:代理;env:HTTP_PROXY" `
	NoInject    []string
	LocalConfig conf_center.Local
	// config字段顺序不能变,ConfigCenter 保持在最后
	ConfigCenter conf_center.Config
}

func (*EnvConfig) AfterInject

func (c *EnvConfig) AfterInject()

type RootConfig

type RootConfig struct {
	Executable string
	ExecDir    string
	// 配置文件路径
	ConfPath string `flag:"name:config;short:c;usage:配置文件路径,默认./config.xxx或./config/config.xxx;env:CONFIG"`
	BasicConfig
	EnvConfig
}

Jump to

Keyboard shortcuts

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