Documentation ¶
Index ¶
- func RegisterConfigurationProvider(driverName string, fn NewConfigProviderFunc)
- type Config
- type Configuration
- type ConfigurationProvider
- type HOCONConfigProvider
- type HOCONConfiguration
- func (p *HOCONConfiguration) GetBoolean(path string, defaultVal ...bool) bool
- func (p *HOCONConfiguration) GetBooleanList(path string) []bool
- func (p *HOCONConfiguration) GetByteList(path string) []byte
- func (p *HOCONConfiguration) GetByteSize(path string) *big.Int
- func (p *HOCONConfiguration) GetConfig(path string) Configuration
- func (p *HOCONConfiguration) GetFloat32(path string, defaultVal ...float32) float32
- func (p *HOCONConfiguration) GetFloat32List(path string) []float32
- func (p *HOCONConfiguration) GetFloat64(path string, defaultVal ...float64) float64
- func (p *HOCONConfiguration) GetFloat64List(path string) []float64
- func (p *HOCONConfiguration) GetInt32(path string, defaultVal ...int32) int32
- func (p *HOCONConfiguration) GetInt32List(path string) []int32
- func (p *HOCONConfiguration) GetInt64(path string, defaultVal ...int64) int64
- func (p *HOCONConfiguration) GetInt64List(path string) []int64
- func (p *HOCONConfiguration) GetString(path string, defaultVal ...string) string
- func (p *HOCONConfiguration) GetStringList(path string) []string
- func (p *HOCONConfiguration) GetTimeDuration(path string, defaultVal ...time.Duration) time.Duration
- func (p *HOCONConfiguration) GetTimeDurationInfiniteNotAllowed(path string, defaultVal ...time.Duration) time.Duration
- func (p *HOCONConfiguration) HasPath(path string) bool
- func (p *HOCONConfiguration) IsArray(path string) bool
- func (p *HOCONConfiguration) IsEmpty() bool
- func (p *HOCONConfiguration) IsObject(path string) bool
- func (p *HOCONConfiguration) Keys() []string
- func (p *HOCONConfiguration) String() string
- func (p *HOCONConfiguration) WithFallback(fallback Configuration) Configuration
- type NewConfigProviderFunc
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterConfigurationProvider ¶
func RegisterConfigurationProvider(driverName string, fn NewConfigProviderFunc)
Types ¶
type Config ¶
type Config struct { ConfigFile string ConfigString string Configuration // contains filtered or unexported fields }
func (*Config) WithFallback ¶
func (p *Config) WithFallback(fallback Configuration) Configuration
type Configuration ¶
type Configuration interface { GetBoolean(path string, defaultVal ...bool) bool GetByteSize(path string) *big.Int GetInt32(path string, defaultVal ...int32) int32 GetInt64(path string, defaultVal ...int64) int64 GetString(path string, defaultVal ...string) string GetFloat32(path string, defaultVal ...float32) float32 GetFloat64(path string, defaultVal ...float64) float64 GetTimeDuration(path string, defaultVal ...time.Duration) time.Duration GetTimeDurationInfiniteNotAllowed(path string, defaultVal ...time.Duration) time.Duration GetBooleanList(path string) []bool GetFloat32List(path string) []float32 GetFloat64List(path string) []float64 GetInt32List(path string) []int32 GetInt64List(path string) []int64 GetByteList(path string) []byte GetStringList(path string) []string GetConfig(path string) Configuration WithFallback(fallback Configuration) Configuration HasPath(path string) bool Keys() []string IsEmpty() bool IsObject(path string) bool IsArray(path string) bool String() string }
func NewHOCONConfiguration ¶
func NewHOCONConfiguration(conf *configuration.Config) Configuration
type ConfigurationProvider ¶
type ConfigurationProvider interface { LoadConfig(filename string) Configuration ParseString(cfgStr string) Configuration }
func NewConfigurationProvider ¶
func NewConfigurationProvider(driverName string) (provider ConfigurationProvider, err error)
func NewHOCONConifProvider ¶
func NewHOCONConifProvider() (ConfigurationProvider, error)
type HOCONConfigProvider ¶
type HOCONConfigProvider struct { }
func (*HOCONConfigProvider) LoadConfig ¶
func (p *HOCONConfigProvider) LoadConfig(filename string) Configuration
func (*HOCONConfigProvider) ParseString ¶
func (p *HOCONConfigProvider) ParseString(cfgStr string) Configuration
type HOCONConfiguration ¶
type HOCONConfiguration struct {
*configuration.Config
}
func (*HOCONConfiguration) GetBoolean ¶
func (p *HOCONConfiguration) GetBoolean(path string, defaultVal ...bool) bool
func (*HOCONConfiguration) GetBooleanList ¶
func (p *HOCONConfiguration) GetBooleanList(path string) []bool
func (*HOCONConfiguration) GetByteList ¶
func (p *HOCONConfiguration) GetByteList(path string) []byte
func (*HOCONConfiguration) GetByteSize ¶
func (p *HOCONConfiguration) GetByteSize(path string) *big.Int
func (*HOCONConfiguration) GetConfig ¶
func (p *HOCONConfiguration) GetConfig(path string) Configuration
func (*HOCONConfiguration) GetFloat32 ¶
func (p *HOCONConfiguration) GetFloat32(path string, defaultVal ...float32) float32
func (*HOCONConfiguration) GetFloat32List ¶
func (p *HOCONConfiguration) GetFloat32List(path string) []float32
func (*HOCONConfiguration) GetFloat64 ¶
func (p *HOCONConfiguration) GetFloat64(path string, defaultVal ...float64) float64
func (*HOCONConfiguration) GetFloat64List ¶
func (p *HOCONConfiguration) GetFloat64List(path string) []float64
func (*HOCONConfiguration) GetInt32 ¶
func (p *HOCONConfiguration) GetInt32(path string, defaultVal ...int32) int32
func (*HOCONConfiguration) GetInt32List ¶
func (p *HOCONConfiguration) GetInt32List(path string) []int32
func (*HOCONConfiguration) GetInt64 ¶
func (p *HOCONConfiguration) GetInt64(path string, defaultVal ...int64) int64
func (*HOCONConfiguration) GetInt64List ¶
func (p *HOCONConfiguration) GetInt64List(path string) []int64
func (*HOCONConfiguration) GetString ¶
func (p *HOCONConfiguration) GetString(path string, defaultVal ...string) string
func (*HOCONConfiguration) GetStringList ¶
func (p *HOCONConfiguration) GetStringList(path string) []string
func (*HOCONConfiguration) GetTimeDuration ¶
func (*HOCONConfiguration) GetTimeDurationInfiniteNotAllowed ¶
func (*HOCONConfiguration) HasPath ¶
func (p *HOCONConfiguration) HasPath(path string) bool
func (*HOCONConfiguration) IsArray ¶
func (p *HOCONConfiguration) IsArray(path string) bool
func (*HOCONConfiguration) IsEmpty ¶
func (p *HOCONConfiguration) IsEmpty() bool
func (*HOCONConfiguration) IsObject ¶
func (p *HOCONConfiguration) IsObject(path string) bool
func (*HOCONConfiguration) Keys ¶
func (p *HOCONConfiguration) Keys() []string
func (*HOCONConfiguration) String ¶
func (p *HOCONConfiguration) String() string
func (*HOCONConfiguration) WithFallback ¶
func (p *HOCONConfiguration) WithFallback(fallback Configuration) Configuration
type NewConfigProviderFunc ¶
type NewConfigProviderFunc func() (ConfigurationProvider, error)
type Option ¶
type Option func(*Config)
func ConfigFile ¶
func ConfigProvider ¶
func ConfigProvider(provider ConfigurationProvider) Option
func ConfigProviderByName ¶
func ConfigString ¶
func WithConfig ¶
func WithConfig(conf Configuration) Option
Click to show internal directories.
Click to hide internal directories.