conf

package
v0.3.67 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: LGPL-2.1 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Name      = self.Name
	Using     = self.Using
	Install   = self.Install
	Uninstall = self.Uninstall
)
View Source
var With _Option

Functions

This section is empty.

Types

type ConfigOptions

type ConfigOptions struct {
	Defaults                             map[string]any // 默认配置
	Flags                                *pflag.FlagSet // 启动命令参数
	AutomaticEnv                         bool           // 合并环境变量
	EnvPrefix                            string         // 环境变量前缀
	LocalPath                            string         // 本地配置文件路径
	RemoteProvider                       string         // 远端配置类型(etcd3,consul...)
	RemoteEndpoint                       string         // 远端地址
	RemotePath                           string         // 远端路径
	AutoHotFix                           bool           // 自动热更新
	AutoHotFixRemoteCheckingIntervalTime time.Duration  // 自动热更新远端配置检测间隔时间
}

ConfigOptions 所有选项

type IConfig

type IConfig interface {
	// AppConf 当前应用程序配置
	AppConf() *viper.Viper
	// ServiceConf 当前服务配置
	ServiceConf() *viper.Viper
	// Hotfix 热更新
	Hotfix() error
}

IConfig 配置接口

Jump to

Keyboard shortcuts

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