config

package
v1.23.0-dev Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 5 Imported by: 0 modules, 0 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

This section is empty.

Variables

This section is empty.

Functions

func SetCfgSecKeyGetter

func SetCfgSecKeyGetter(p CfgSecKeyGetter)

func SetDynGetter

func SetDynGetter(p DynKeyGetter)

Types

type CfgSecKey

type CfgSecKey struct {
	Sec, Key string
}

type CfgSecKeyGetter

type CfgSecKeyGetter interface {
	GetValue(sec, key string) (v string, has bool)
}

func GetCfgSecKeyGetter

func GetCfgSecKeyGetter() CfgSecKeyGetter

type DynKeyGetter

type DynKeyGetter interface {
	GetValue(ctx context.Context, key string) (v string, has bool)
	GetRevision(ctx context.Context) int
	InvalidateCache()
}

func GetDynGetter

func GetDynGetter() DynKeyGetter

type Value

type Value[T any] struct {
	// contains filtered or unexported fields
}

func ValueJSON added in v1.22.0

func ValueJSON[T any](dynKey string) *Value[T]

func (*Value[T]) DynKey

func (value *Value[T]) DynKey() string

func (*Value[T]) Value

func (value *Value[T]) Value(ctx context.Context) (v T)

func (*Value[T]) WithDefault added in v1.22.0

func (value *Value[T]) WithDefault(def T) *Value[T]

func (*Value[T]) WithFileConfig added in v1.22.0

func (value *Value[T]) WithFileConfig(cfgSecKey CfgSecKey) *Value[T]

Jump to

Keyboard shortcuts

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