config

package
v1.10.8 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoValue indicates no value was set for the config
	ErrNoValue = errors.New("config: no value set")

	// ErrShutdown indicates the use of a Config after calling Shutdown
	ErrShutdown = errors.New("config: shutdown")
)
View Source
var NoopConfig = &noopConfig{}

NoopConfig is a config that does not yield any values.

Functions

This section is empty.

Types

type Bool

type Bool interface {
	Get(ctx context.Context) bool
	GetSafe(ctx context.Context) (bool, error)
	Shutdown()
}

Bool provides a boolean typed config.Config.

type Bytes

type Bytes interface {
	Get(ctx context.Context) []byte
	GetSafe(ctx context.Context) ([]byte, error)
	Shutdown()
}

Bytes provides a bytes typed config.Config.

type Config

type Config interface {
	// Get returns the latest config value
	Get(ctx context.Context) (interface{}, error)

	// Shutdown signals the config to stop all underlying resources
	Shutdown()
}

Config is an interface for getting a configuration value

type Duration

type Duration interface {
	Get(ctx context.Context) time.Duration
	GetSafe(ctx context.Context) (time.Duration, error)
	Shutdown()
}

Duration provides a time.Duration typed config.Config.

type Encrypted

type Encrypted interface {
	Get(ctx context.Context) []byte
	GetSafe(ctx context.Context) ([]byte, error)
	Shutdown()
}

Encrypted provides an encrypted bytes typed config.Config.

type Float64

type Float64 interface {
	Get(ctx context.Context) float64
	GetSafe(ctx context.Context) (float64, error)
	Shutdown()
}

Float64 provides a float64 typed config.Config.

type Int64

type Int64 interface {
	Get(ctx context.Context) int64
	GetSafe(ctx context.Context) (int64, error)
	Shutdown()
}

Int64 provides an int64 typed config.Config.

type String

type String interface {
	Get(ctx context.Context) string
	GetSafe(ctx context.Context) (string, error)
	Shutdown()
}

String provides a string typed config.Config.

type Uint64

type Uint64 interface {
	Get(ctx context.Context) uint64
	GetSafe(ctx context.Context) (uint64, error)
	Shutdown()
}

Uint64 provides a uint64 typed config.Config.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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