config

package
v1.20.5 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 8 Imported by: 4 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const CheckExpiredTemporalValuesPeriod = 15 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config is a storage for all runtime parameters.

func NewConfig

func NewConfig(logger *log.Logger) *Config

func (*Config) Has

func (c *Config) Has(name string) bool

func (*Config) IsValid added in v1.3.1

func (c *Config) IsValid(name, value string) error

IsValid validates runtime config parameter

func (*Config) LastError

func (c *Config) LastError(name string) error

func (*Config) List

func (c *Config) List() []map[string]string

func (*Config) Register

func (c *Config) Register(name string, description string, defaultValue string, onChange func(oldValue string, newValue string) error, forceDuration func(oldValue string, newValue string) time.Duration)

func (*Config) Set

func (c *Config) Set(name string, value string)

Set updates a value of the parameter by its name. Deletes a temporal value if set.

func (*Config) SetTemporarily

func (c *Config) SetTemporarily(name string, value string, duration time.Duration)

func (*Config) String

func (c *Config) String() string

func (*Config) Unset

func (c *Config) Unset(name string)

Unset removes temporal value and value for parameter by its name.

func (*Config) Value

func (c *Config) Value(name string) string

type Parameter

type Parameter struct {
	// contains filtered or unexported fields
}

Parameter is a runtime configuration parameter.

type TemporalValue

type TemporalValue struct {
	// contains filtered or unexported fields
}

TemporalValue is a value for parameter that will expire in the future.

Jump to

Keyboard shortcuts

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