Documentation
¶
Index ¶
- Variables
- func SetCfgSecKeyGetter(p CfgSecKeyGetter)
- func SetDynGetter(p DynKeyGetter)
- type CfgSecKey
- type CfgSecKeyGetter
- type DynKeyGetter
- type Option
- func (opt *Option[T]) DefaultValue() T
- func (opt *Option[T]) DynKey() string
- func (opt *Option[T]) GetDefaultValue() any
- func (opt *Option[T]) HasValue(ctx context.Context) bool
- func (opt *Option[T]) Value(ctx context.Context) (v T)
- func (opt *Option[T]) ValueRevision(ctx context.Context) (v T, rev int, has bool)
- func (opt *Option[T]) WithDefaultFunc(f func() T) *Option[T]
- func (opt *Option[T]) WithDefaultSimple(def T) *Option[T]
- func (opt *Option[T]) WithEmptyAsDefault() *Option[T]
- func (opt *Option[T]) WithFileConfig(cfgSecKey CfgSecKey) *Option[T]
- type OptionInterface
Constants ¶
This section is empty.
Variables ¶
View Source
var SkipDatabaseConfig bool
Functions ¶
func SetCfgSecKeyGetter ¶
func SetCfgSecKeyGetter(p CfgSecKeyGetter)
func SetDynGetter ¶
func SetDynGetter(p DynKeyGetter)
Types ¶
type CfgSecKeyGetter ¶
func GetCfgSecKeyGetter ¶
func GetCfgSecKeyGetter() CfgSecKeyGetter
type DynKeyGetter ¶
type DynKeyGetter interface {
GetValue(ctx context.Context, key string) (v string, has bool)
GetRevision(ctx context.Context) int
InvalidateCache()
}
func GetDynGetter ¶
func GetDynGetter() DynKeyGetter
type Option ¶
type Option[T any] struct { // contains filtered or unexported fields }
func (*Option[T]) DefaultValue ¶
func (opt *Option[T]) DefaultValue() T
func (*Option[T]) GetDefaultValue ¶
func (*Option[T]) ValueRevision ¶
func (*Option[T]) WithDefaultFunc ¶
WithDefaultFunc sets the default value with a function The "def" value might be changed during runtime (e.g.: Unmarshal with default), so it shouldn't use the same pointer or slice
func (*Option[T]) WithDefaultSimple ¶
func (*Option[T]) WithEmptyAsDefault ¶
func (*Option[T]) WithFileConfig ¶
type OptionInterface ¶
type OptionInterface interface {
GetDefaultValue() any
}
OptionInterface is used to overcome Golang's generic interface limitation
func GetConfigOption ¶
func GetConfigOption(dynKey string) OptionInterface
Click to show internal directories.
Click to hide internal directories.