Documentation
¶
Index ¶
- Constants
- func Merge(from any, to any) (any, error)
- type Builder
- type Change
- type ChangeType
- type Codec
- type DynamicResolver
- type EnvOption
- type EnvProvider
- type FileBeforeGet
- type FileOption
- type Flag
- type GetContext
- type GlobOption
- type GlobProviderResolver
- type JsonOption
- type Marshaler
- type Provider
- func NewDotEnv(file string, options ...FileOption) Provider
- func NewDynamic(resolver DynamicResolver) Provider
- func NewFile(file string, codec Codec, options ...FileOption) Provider
- func NewFlag(flags []Flag, args []string) Provider
- func NewGlob(directory string, pattern string, options ...GlobOption) Provider
- func NewGlobUp(directory string, pattern string, options ...GlobOption) Provider
- func NewJson(file string, options ...FileOption) Provider
- func NewMemory(memory any, transformers ...Transformer) Provider
- func NewToml(file string, options ...FileOption) Provider
- func NewYaml(file string, options ...FileOption) Provider
- func TransformProvider(transform func(any) (any, error)) Provider
- type SetContext
- type StringFlag
- type StringSliceFlag
- type Transformer
- type Unmarshaler
Constants ¶
View Source
const ( Create changeType = "create" Update changeType = "update" Delete changeType = "delete" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Change ¶ added in v0.1.2
type Change struct { ChangeType ChangeType Path []string From any To any }
type ChangeType ¶ added in v0.1.2
type ChangeType interface {
// contains filtered or unexported methods
}
type Codec ¶ added in v0.1.3
type Codec interface { Marshaler Unmarshaler }
func NewJsonCodec ¶ added in v0.1.3
func NewJsonCodec() Codec
func NewTomlCodec ¶ added in v0.1.3
func NewTomlCodec() Codec
func NewYamlCodec ¶ added in v0.1.3
func NewYamlCodec() Codec
type DynamicResolver ¶ added in v0.1.5
type DynamicResolver func(ctx *GetContext) (Provider, error)
type EnvOption ¶ added in v0.1.4
type EnvOption struct { Prefix string Transformers []Transformer }
type EnvProvider ¶
type EnvProvider struct {
// contains filtered or unexported fields
}
func NewEnv ¶
func NewEnv(options ...EnvOption) *EnvProvider
func (*EnvProvider) Get ¶
func (p *EnvProvider) Get(ctx *GetContext) (any, error)
type FileBeforeGet ¶ added in v0.1.4
type FileBeforeGet func(ctx *GetContext, provider Provider, file string) (any, error)
type FileOption ¶ added in v0.1.4
type FileOption struct { Transformers []Transformer BeforeGet FileBeforeGet }
type GetContext ¶ added in v0.1.3
type GetContext struct {
MergedConfiguration any
}
type GlobOption ¶ added in v0.1.4
type GlobOption struct { Transformers []Transformer Resolver GlobProviderResolver }
type GlobProviderResolver ¶ added in v0.1.3
GlobProviderResolver returns the Provider for the given glob match
type JsonOption ¶ added in v0.1.4
type JsonOption struct {
Transformers []Transformer
}
type Provider ¶
type Provider interface {
Get(ctx *GetContext) (any, error)
}
func NewDotEnv ¶ added in v0.1.1
func NewDotEnv(file string, options ...FileOption) Provider
func NewDynamic ¶ added in v0.1.5
func NewDynamic(resolver DynamicResolver) Provider
func NewFile ¶ added in v0.1.3
func NewFile(file string, codec Codec, options ...FileOption) Provider
func NewJson ¶
func NewJson(file string, options ...FileOption) Provider
func NewMemory ¶ added in v0.1.3
func NewMemory(memory any, transformers ...Transformer) Provider
func NewToml ¶
func NewToml(file string, options ...FileOption) Provider
func NewYaml ¶
func NewYaml(file string, options ...FileOption) Provider
type SetContext ¶ added in v0.1.3
type SetContext struct{}
type StringFlag ¶
type StringFlag struct { Name string Default string Usage string // contains filtered or unexported fields }
func (*StringFlag) Set ¶
func (s *StringFlag) Set(value string) error
func (*StringFlag) String ¶
func (s *StringFlag) String() string
func (*StringFlag) Value ¶
func (s *StringFlag) Value() any
type StringSliceFlag ¶
type StringSliceFlag struct { Name string Default []string Usage string // contains filtered or unexported fields }
func (*StringSliceFlag) Set ¶
func (s *StringSliceFlag) Set(value string) error
func (*StringSliceFlag) String ¶
func (s *StringSliceFlag) String() string
func (*StringSliceFlag) Value ¶
func (s *StringSliceFlag) Value() any
type Transformer ¶ added in v0.1.3
func FuncTransformer ¶ added in v0.1.3
func FuncTransformer(transform func(any) (any, error)) Transformer
type Unmarshaler ¶ added in v0.1.3
Click to show internal directories.
Click to hide internal directories.