wrapper

package
v1.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func NewBoolConfig(override config.Config, defaultValue bool) config.Bool

NewBoolConfig returns a new bool config utility wrapper

func NewBytesConfig

func NewBytesConfig(override config.Config, defaultValue []byte) config.Bytes

NewBytesConfig returns a new byte array config utility wrapper

func NewDurationConfig

func NewDurationConfig(override config.Config, defaultValue time.Duration) config.Duration

NewDurationConfig returns a new duration config utility wrapper

func NewFloat64Config

func NewFloat64Config(override config.Config, defaultValue float64) config.Float64

NewFloat64Config returns a new float64 config utility wrapper

func NewInt64Config

func NewInt64Config(override config.Config, defaultValue int64) config.Int64

NewInt64Config returns a new int64 config utility wrapper

func NewStringConfig

func NewStringConfig(config config.Config, defaultValue string) config.String

NewStringConfig returns a new duration string utility wrapper

func NewUint64Config

func NewUint64Config(override config.Config, defaultValue uint64) config.Uint64

NewUint64Config returns a new uint64 config 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

Get is a wrapper for GetSafe that ignores the returned error

func (*DurationConfig) GetSafe

func (c *DurationConfig) GetSafe(ctx context.Context) (time.Duration, 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 (*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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL