rootconf

package
v0.0.40 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicConfig

type BasicConfig struct {
	// 模块名
	Module string `flag:"name:mod;short:m;default:cherry-app;usage:模块名;env:MODULE"`
	// 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:debug;usage:是否测试;env:DEBUG"`
	ConfigTemplateDir string `flag:"name:conf_tmpl_dir;short:t;usage:是否生成配置模板;env:CONFIG_TEMPLATE_DIR"`
	// 代理, socks5://localhost:1080
	Proxy       string `flag:"name:proxy;short:p;default:'socks5://localhost:1080';usage:代理;env:HTTP_PROXY" `
	EnableTrace bool   `flag:"name:trace;default:true;usage:系统trace;env:ENABLE_TRACE"`
	NoInject    []string
	// config字段顺序不能变,ConfigCenter 保持在最后
	ConfigCenter conf_center.Config
}

func (*EnvConfig) AfterInject

func (c *EnvConfig) AfterInject()

type RootConfig

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

Jump to

Keyboard shortcuts

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