Documentation
¶
Index ¶
- Constants
- func Fill(root IConfiguration, path string, out any)
- func Get[T any](root IConfiguration, path string) T
- func GetBool(config IConfiguration, key string) bool
- func GetByType(ty reflect.Type, root IConfiguration, path string) any
- func GetFloat64(config IConfiguration, key string) float64
- func GetInt64(config IConfiguration, key string) int64
- func GetUint64(config IConfiguration, key string) uint64
- func TryGetBool(config IConfiguration, key string) (bool, bool)
- func TryGetFloat64(config IConfiguration, key string) (float64, bool)
- func TryGetInt64(config IConfiguration, key string) (int64, bool)
- func TryGetUint64(config IConfiguration, key string) (uint64, bool)
- type Builder
- type IConfiguration
- type IConfigurationBuilder
- type IConfigurationManager
- type IConfigurationProvider
- type IConfigurationRoot
- type IConfigurationSection
- type IConfigurationSource
- type Manager
- func (ss *Manager) AddSource(source IConfigurationSource)
- func (ss *Manager) BuildConfigurationRoot() IConfigurationRoot
- func (ss *Manager) Get(key string) string
- func (ss *Manager) GetChildren() container.List[IConfigurationSection]
- func (ss *Manager) GetChildrenByPath(path string) container.List[IConfigurationSection]
- func (ss *Manager) GetProperties() container.Map[string, any]
- func (ss *Manager) GetProviders() container.List[IConfigurationProvider]
- func (ss *Manager) GetReloadNotifier() notifier.INotifier
- func (ss *Manager) GetSection(key string) IConfigurationSection
- func (ss *Manager) GetSources() container.List[IConfigurationSource]
- func (ss *Manager) Reload()
- func (ss *Manager) Set(key string, value string)
- func (ss *Manager) TryGet(key string) (value string, ok bool)
- type Notifier
- type Provider
- func (ss *Provider) Get(key string) string
- func (ss *Provider) GetChildKeys(parentPath string) container.List[string]
- func (ss *Provider) GetReloadNotifier() notifier.INotifier
- func (ss *Provider) Load()
- func (ss *Provider) OnReload()
- func (ss *Provider) Replace(data *container.CaseInsensitiveStringMap[string])
- func (ss *Provider) Set(key string, value string)
- func (ss *Provider) TryGet(key string) (value string, ok bool)
- type Root
- func (ss *Root) Get(key string) string
- func (ss *Root) GetChildren() container.List[IConfigurationSection]
- func (ss *Root) GetChildrenByPath(path string) container.List[IConfigurationSection]
- func (ss *Root) GetProviders() container.List[IConfigurationProvider]
- func (ss *Root) GetReloadNotifier() notifier.INotifier
- func (ss *Root) GetSection(key string) IConfigurationSection
- func (ss *Root) Reload()
- func (ss *Root) Set(key string, value string)
- func (ss *Root) TryGet(key string) (value string, ok bool)
- type Section
- func (ss *Section) Get(key string) string
- func (ss *Section) GetChildren() container.List[IConfigurationSection]
- func (ss *Section) GetChildrenByPath(path string) container.List[IConfigurationSection]
- func (ss *Section) GetKey() string
- func (ss *Section) GetPath() string
- func (ss *Section) GetReloadNotifier() notifier.INotifier
- func (ss *Section) GetSection(key string) IConfigurationSection
- func (ss *Section) GetValue() (string, bool)
- func (ss *Section) Set(key string, value string)
- func (ss *Section) SetValue(key, value string)
- func (ss *Section) TryGet(key string) (value string, ok bool)
Constants ¶
View Source
const KeyDelimiter = ":"
Variables ¶
This section is empty.
Functions ¶
func Fill ¶
func Fill(root IConfiguration, path string, out any)
func Get ¶
func Get[T any](root IConfiguration, path string) T
func GetBool ¶
func GetBool(config IConfiguration, key string) bool
func GetFloat64 ¶
func GetFloat64(config IConfiguration, key string) float64
func GetInt64 ¶
func GetInt64(config IConfiguration, key string) int64
func GetUint64 ¶
func GetUint64(config IConfiguration, key string) uint64
func TryGetBool ¶
func TryGetBool(config IConfiguration, key string) (bool, bool)
func TryGetFloat64 ¶
func TryGetFloat64(config IConfiguration, key string) (float64, bool)
func TryGetInt64 ¶
func TryGetInt64(config IConfiguration, key string) (int64, bool)
func TryGetUint64 ¶
func TryGetUint64(config IConfiguration, key string) (uint64, bool)
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder() *Builder
func (*Builder) AddSource ¶
func (ss *Builder) AddSource(source IConfigurationSource)
func (*Builder) BuildConfigurationRoot ¶
func (ss *Builder) BuildConfigurationRoot() IConfigurationRoot
func (*Builder) GetSources ¶
func (ss *Builder) GetSources() container.List[IConfigurationSource]
type IConfiguration ¶
type IConfiguration interface {
Get(key string) string
TryGet(key string) (value string, ok bool)
Set(key string, value string)
GetSection(key string) IConfigurationSection
GetChildren() container.List[IConfigurationSection]
GetChildrenByPath(path string) container.List[IConfigurationSection]
GetReloadNotifier() notifier.INotifier
}
type IConfigurationBuilder ¶
type IConfigurationBuilder interface {
GetProperties() container.Map[string, any]
GetSources() container.List[IConfigurationSource]
AddSource(source IConfigurationSource)
BuildConfigurationRoot() IConfigurationRoot
}
type IConfigurationManager ¶
type IConfigurationManager interface {
IConfigurationBuilder
IConfigurationRoot
}
type IConfigurationProvider ¶
type IConfigurationRoot ¶
type IConfigurationRoot interface {
IConfiguration
Reload()
GetProviders() container.List[IConfigurationProvider]
}
func NewConfigurationRoot ¶
func NewConfigurationRoot(providers container.List[IConfigurationProvider]) IConfigurationRoot
type IConfigurationSection ¶
type IConfigurationSource ¶
type IConfigurationSource interface {
BuildConfigurationProvider(builder IConfigurationBuilder) IConfigurationProvider
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager() *Manager
func (*Manager) AddSource ¶
func (ss *Manager) AddSource(source IConfigurationSource)
func (*Manager) BuildConfigurationRoot ¶
func (ss *Manager) BuildConfigurationRoot() IConfigurationRoot
func (*Manager) GetChildren ¶
func (ss *Manager) GetChildren() container.List[IConfigurationSection]
func (*Manager) GetChildrenByPath ¶
func (ss *Manager) GetChildrenByPath(path string) container.List[IConfigurationSection]
func (*Manager) GetProviders ¶
func (ss *Manager) GetProviders() container.List[IConfigurationProvider]
func (*Manager) GetReloadNotifier ¶
func (*Manager) GetSection ¶
func (ss *Manager) GetSection(key string) IConfigurationSection
func (*Manager) GetSources ¶
func (ss *Manager) GetSources() container.List[IConfigurationSource]
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
func NewNotifier ¶
func NewNotifier() *Notifier
func (*Notifier) RegisterNotifyCallback ¶
func (ss *Notifier) RegisterNotifyCallback(callback func())
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func NewProvider ¶
func NewProvider() *Provider
func (*Provider) GetChildKeys ¶
func (*Provider) GetReloadNotifier ¶
type Root ¶
type Root struct {
// contains filtered or unexported fields
}
func (*Root) GetChildren ¶
func (ss *Root) GetChildren() container.List[IConfigurationSection]
func (*Root) GetChildrenByPath ¶
func (ss *Root) GetChildrenByPath(path string) container.List[IConfigurationSection]
func (*Root) GetProviders ¶
func (ss *Root) GetProviders() container.List[IConfigurationProvider]
func (*Root) GetReloadNotifier ¶
func (*Root) GetSection ¶
func (ss *Root) GetSection(key string) IConfigurationSection
type Section ¶
type Section struct {
// contains filtered or unexported fields
}
func NewSection ¶
func NewSection(root IConfigurationRoot, path string) *Section
func (*Section) GetChildren ¶
func (ss *Section) GetChildren() container.List[IConfigurationSection]
func (*Section) GetChildrenByPath ¶
func (ss *Section) GetChildrenByPath(path string) container.List[IConfigurationSection]
func (*Section) GetReloadNotifier ¶
func (*Section) GetSection ¶
func (ss *Section) GetSection(key string) IConfigurationSection
Source Files
¶
Click to show internal directories.
Click to hide internal directories.