config

package
v1.22.5 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 5 Imported by: 0

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