config

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 6 Imported by: 6

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() *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