Documentation ¶
Index ¶
- Variables
- func NewBoolConfig(override config.Config, defaultValue bool) config.Bool
- func NewBytesConfig(override config.Config, defaultValue []byte) config.Bytes
- func NewDurationConfig(override config.Config, defaultValue time.Duration) config.Duration
- func NewFloat64Config(override config.Config, defaultValue float64) config.Float64
- func NewInt64Config(override config.Config, defaultValue int64) config.Int64
- func NewStringConfig(config config.Config, defaultValue string) config.String
- func NewUint64Config(override config.Config, defaultValue uint64) config.Uint64
- type BoolConfig
- type BytesConfig
- type DurationConfig
- type Float64Config
- type Int64Config
- type StringConfig
- type Uint64Config
Constants ¶
This section is empty.
Variables ¶
var ErrUnsuportedConversion = errors.New("config: wrapper conversion from source type not implemented")
ErrUnsuportedConversion indicates the wrapper does not implement conversion from the source type
Functions ¶
func NewBoolConfig ¶
NewBoolConfig returns a new bool config utility wrapper
func NewBytesConfig ¶
NewBytesConfig returns a new byte array config utility wrapper
func NewDurationConfig ¶
NewDurationConfig returns a new duration config utility wrapper
func NewFloat64Config ¶
NewFloat64Config returns a new float64 config utility wrapper
func NewInt64Config ¶
NewInt64Config returns a new int64 config utility wrapper
func NewStringConfig ¶
NewStringConfig returns a new duration string utility wrapper
Types ¶
type BoolConfig ¶
type BoolConfig struct {
// contains filtered or unexported fields
}
BoolConfig is a utility wrapper for a bool config
func (*BoolConfig) Get ¶
func (c *BoolConfig) Get(ctx context.Context) bool
Get is a wrapper for GetSafe that ignores the returned error
func (*BoolConfig) GetSafe ¶
func (c *BoolConfig) GetSafe(ctx context.Context) (bool, error)
GetSafe gets a config value and propagates any errors that arise. A best-effort attempt is made to return the last known value
func (*BoolConfig) Shutdown ¶
func (c *BoolConfig) Shutdown()
Shutdown signals the config to stop all underlying resources
type BytesConfig ¶
type BytesConfig struct {
// contains filtered or unexported fields
}
BytesConfig is a utility wrapper for a byte array config
func (*BytesConfig) Get ¶
func (c *BytesConfig) Get(ctx context.Context) []byte
Get is a wrapper for GetSafe that ignores the returned error
func (*BytesConfig) GetSafe ¶
func (c *BytesConfig) GetSafe(ctx context.Context) ([]byte, error)
GetSafe gets a config value and propagates any errors that arise. A best-effort attempt is made to return the last known value
func (*BytesConfig) Shutdown ¶
func (c *BytesConfig) Shutdown()
Shutdown signals the config to stop all underlying resources
type DurationConfig ¶
type DurationConfig struct {
// contains filtered or unexported fields
}
DurationConfig is a utility wrapper for a duration config
func (*DurationConfig) Get ¶
func (c *DurationConfig) Get(ctx context.Context) time.Duration
Get is a wrapper for GetSafe that ignores the returned error
func (*DurationConfig) GetSafe ¶
GetSafe gets a config value and propagates any errors that arise. A best-effort attempt is made to return the last known value
func (*DurationConfig) Shutdown ¶
func (c *DurationConfig) Shutdown()
Shutdown signals the config to stop all underlying resources
type Float64Config ¶
type Float64Config struct {
// contains filtered or unexported fields
}
Float64Config is a utility wrapper for a float64 config
func (*Float64Config) Get ¶
func (c *Float64Config) Get(ctx context.Context) float64
Get is a wrapper for GetSafe that ignores the returned error
func (*Float64Config) GetSafe ¶
func (c *Float64Config) GetSafe(ctx context.Context) (float64, error)
GetSafe gets a config value and propagates any errors that arise. A best-effort attempt is made to return the last known value
func (*Float64Config) Shutdown ¶
func (c *Float64Config) Shutdown()
Shutdown signals the config to stop all underlying resources
type Int64Config ¶
type Int64Config struct {
// contains filtered or unexported fields
}
Int64Config is a utility wrapper for a int64 config
func (*Int64Config) Get ¶
func (c *Int64Config) Get(ctx context.Context) int64
Get is a wrapper for GetSafe that ignores the returned error
func (*Int64Config) GetSafe ¶
func (c *Int64Config) GetSafe(ctx context.Context) (int64, error)
GetSafe gets a config value and propagates any errors that arise. A best-effort attempt is made to return the last known value
func (*Int64Config) Shutdown ¶
func (c *Int64Config) Shutdown()
Shutdown signals the config to stop all underlying resources
type StringConfig ¶
type StringConfig struct {
// contains filtered or unexported fields
}
StringConfig is a utility wrapper for a string config
func (*StringConfig) Get ¶
func (c *StringConfig) Get(ctx context.Context) string
Get is a wrapper for GetSafe that ignores the returned error
func (*StringConfig) GetSafe ¶
func (c *StringConfig) GetSafe(ctx context.Context) (string, error)
GetSafe gets a config value and propagates any errors that arise. A best-effort attempt is made to return the last known value
func (*StringConfig) Shutdown ¶
func (c *StringConfig) Shutdown()
Shutdown signals the config to stop all underlying resources
type Uint64Config ¶
type Uint64Config struct {
// contains filtered or unexported fields
}
Uint64Config is a utility wrapper for a uint64 config
func (*Uint64Config) Get ¶
func (c *Uint64Config) Get(ctx context.Context) uint64
Get is a wrapper for GetSafe that ignores the returned error
func (*Uint64Config) GetSafe ¶
func (c *Uint64Config) GetSafe(ctx context.Context) (uint64, error)
GetSafe gets a config value and propagates any errors that arise. A best-effort attempt is made to return the last known value
func (*Uint64Config) Shutdown ¶
func (c *Uint64Config) Shutdown()
Shutdown signals the config to stop all underlying resources