Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v3.1.61 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT, 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

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

func (*Value[T]) DefaultValue

func (value *Value[T]) DefaultValue() 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

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

func (*Value[T]) WithFileConfig

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

Source Files

  • getter.go
  • value.go

Jump to

Keyboard shortcuts

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