conf

package
v0.1.35 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: LGPL-2.1 Imports: 8 Imported by: 0

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 {
	Format         string         // 配置格式(json,yaml,ini...)
	LocalPath      string         // 本地配置文件路径
	RemoteProvider string         // 远端配置类型(etcd3,consul...)
	RemoteEndpoint string         // 远端地址
	RemotePath     string         // 远端路径
	AutoUpdate     bool           // 是否热更新
	DefaultKVs     map[string]any // 默认配置
}

ConfigOptions 所有选项

type IConfig

type IConfig interface {
	IVisitConf
	Whole() IVisitConf
}

IConfig 配置接口

type IVisitConf

type IVisitConf interface {
	Sub(key string) IVisitConf
	Get(key string) any
	GetString(key string) string
	GetBool(key string) bool
	GetInt(key string) int
	GetInt32(key string) int32
	GetInt64(key string) int64
	GetUint(key string) uint
	GetUint16(key string) uint16
	GetUint32(key string) uint32
	GetUint64(key string) uint64
	GetFloat64(key string) float64
	GetTime(key string) time.Time
	GetDuration(key string) time.Duration
	GetIntSlice(key string) []int
	GetStringSlice(key string) []string
	GetStringMap(key string) map[string]any
	GetStringMapString(key string) map[string]string
	GetStringMapStringSlice(key string) map[string][]string
	GetSizeInBytes(key string) uint
	GetAllKeys() []string
	GetAllSettings() map[string]any
}

IVisitConf 访问配置

Jump to

Keyboard shortcuts

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