Documentation ¶
Index ¶
- Constants
- type ConfigAdapter
- func (a *ConfigAdapter) Close() error
- func (a *ConfigAdapter) GetAdapter(path ...string) (*ConfigAdapter, error)
- func (a *ConfigAdapter) GetAdapterOrNil(path ...string) *ConfigAdapter
- func (a *ConfigAdapter) GetString(path ...string) (string, error)
- func (a *ConfigAdapter) GetStringOrDefault(defaultValue string, path ...string) string
- func (a *ConfigAdapter) GetValue(path ...string) (any, error)
- func (a *ConfigAdapter) GetValueOrDefault(defaultValue any, path ...string) any
- func (a *ConfigAdapter) LoadFromArgs(prefix string) error
- func (a *ConfigAdapter) LoadFromEnv(prefix string) error
- func (a *ConfigAdapter) LoadFromFileJson(filePath string) error
- func (a *ConfigAdapter) LoadFromJson(cfgStr []byte) error
- func (a *ConfigAdapter) SetValue(val any, path ...string) error
- func (a *ConfigAdapter) Setup() (err error)
- func (a *ConfigAdapter) Unmarshal(destination interface{}, skipRequired bool) error
- func (a *ConfigAdapter) UnmarshalPath(destination interface{}, skipRequired bool, path ...string) error
Constants ¶
View Source
const DefaultConfigEnvPrefix string = "RADIAN"
View Source
const DefaultJsonConfigPath string = "config.json"
View Source
const TagConfigName = "config"
View Source
const TagConfigRequiredName = "required"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigAdapter ¶ added in v0.2.3
type ConfigAdapter struct { *adapter.BaseAdapter // contains filtered or unexported fields }
func NewConfigAdapter ¶ added in v0.2.3
func NewConfigAdapter(name string) *ConfigAdapter
func (*ConfigAdapter) Close ¶ added in v0.2.5
func (a *ConfigAdapter) Close() error
func (*ConfigAdapter) GetAdapter ¶ added in v0.2.3
func (a *ConfigAdapter) GetAdapter(path ...string) (*ConfigAdapter, error)
func (*ConfigAdapter) GetAdapterOrNil ¶ added in v0.3.0
func (a *ConfigAdapter) GetAdapterOrNil(path ...string) *ConfigAdapter
func (*ConfigAdapter) GetString ¶ added in v0.2.5
func (a *ConfigAdapter) GetString(path ...string) (string, error)
func (*ConfigAdapter) GetStringOrDefault ¶ added in v0.2.5
func (a *ConfigAdapter) GetStringOrDefault(defaultValue string, path ...string) string
func (*ConfigAdapter) GetValue ¶ added in v0.2.3
func (a *ConfigAdapter) GetValue(path ...string) (any, error)
func (*ConfigAdapter) GetValueOrDefault ¶ added in v0.2.5
func (a *ConfigAdapter) GetValueOrDefault(defaultValue any, path ...string) any
func (*ConfigAdapter) LoadFromArgs ¶ added in v0.2.3
func (a *ConfigAdapter) LoadFromArgs(prefix string) error
func (*ConfigAdapter) LoadFromEnv ¶ added in v0.2.3
func (a *ConfigAdapter) LoadFromEnv(prefix string) error
func (*ConfigAdapter) LoadFromFileJson ¶ added in v0.2.3
func (a *ConfigAdapter) LoadFromFileJson(filePath string) error
func (*ConfigAdapter) LoadFromJson ¶ added in v0.2.3
func (a *ConfigAdapter) LoadFromJson(cfgStr []byte) error
func (*ConfigAdapter) SetValue ¶ added in v0.2.3
func (a *ConfigAdapter) SetValue(val any, path ...string) error
func (*ConfigAdapter) Setup ¶ added in v0.2.5
func (a *ConfigAdapter) Setup() (err error)
func (*ConfigAdapter) Unmarshal ¶ added in v0.2.3
func (a *ConfigAdapter) Unmarshal(destination interface{}, skipRequired bool) error
func (*ConfigAdapter) UnmarshalPath ¶ added in v0.2.3
func (a *ConfigAdapter) UnmarshalPath(destination interface{}, skipRequired bool, path ...string) error
Click to show internal directories.
Click to hide internal directories.