Documentation ¶
Index ¶
- Variables
- func InitGlobalConfig(opts ...Option) error
- type Defaulter
- type IP
- type KnownValueTypes
- type NetCIDR
- type OneOf
- type Option
- type Sink
- type Value
- type ValueOpt
- type ValueT
- func (v ValueT[T]) MustValue(ctx context.Context, opts ...ValueOpt[T]) T
- func (v ValueT[T]) OptDefaulter(f func() (T, error)) ValueOpt[T]
- func (v ValueT[T]) OptSink(f func(T) error) ValueOpt[T]
- func (v ValueT[T]) String() string
- func (v ValueT[T]) Value(_ context.Context, opts ...ValueOpt[T]) (ret T, err error)
- type WithAcceptEnvironment
- type WithDefValue
- type WithSource
- type WithSourceFile
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //ErrTypeCastNotSupported type cast is not supported ErrTypeCastNotSupported = errors.New("type cast not supported") //ErrNotFound value is not found ErrNotFound = errors.New("value not found") )
Functions ¶
func InitGlobalConfig ¶
InitGlobalConfig init global config
Types ¶
type KnownValueTypes ¶
type KnownValueTypes interface { time.Time | NetCIDR | ~[]NetCIDR | IP | ~[]IP | ~int | ~uint | ~int64 | ~uint64 | ~int32 | ~uint32 | ~int16 | ~uint16 | ~int8 | ~uint8 | ~float32 | ~float64 | ~string | ~bool }
KnownValueTypes ...
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option config init option
type Value ¶
type Value[T any] interface { String() string MustValue(ctx context.Context, opts ...ValueOpt[T]) T Value(ctx context.Context, opts ...ValueOpt[T]) (T, error) }
Value config value interface
type ValueOpt ¶
type ValueOpt[T any] interface { // contains filtered or unexported methods }
ValueOpt ...
type ValueT ¶
ValueT typed value accessor
func (ValueT[T]) OptDefaulter ¶
OptDefaulter ...
type WithAcceptEnvironment ¶
WithAcceptEnvironment option
type WithDefValue ¶
type WithDefValue struct { Option Key interface{} Val interface{} }
WithDefValue option
Click to show internal directories.
Click to hide internal directories.