conf

package
v0.1.49 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 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
	GetBoolOrDefault(key string, def bool) bool
	GetIntOrDefault(key string, def int) int
	GetInt32OrDefault(key string, def int32) int32
	GetInt64OrDefault(key string, def int64) int64
	GetUintOrDefault(key string, def uint) uint
	GetUint16OrDefault(key string, def uint16) uint16
	GetUint32OrDefault(key string, def uint32) uint32
	GetUint64OrDefault(key string, def uint64) uint64
	GetFloat64OrDefault(key string, def float64) float64
	GetTimeOrDefault(key string, def time.Time) time.Time
	GetDurationOrDefault(key string, def time.Duration) time.Duration
	GetIntSliceOrDefault(key string, def []int) []int
	GetStringSliceOrDefault(key string, def []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