config

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 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) 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