Documentation ¶
Index ¶
- Variables
- func Fill(inputModelRef any, layers ...Layer) (plocation.Locations, error)
- func R[T any](v T) *T
- type AliasCollisionError
- type AliasesOption
- type CmdlineAlreadyUsedError
- type CmdlineLayer
- type DuplicateEnvPrefixError
- type DuplicateInputStructError
- type DuplicateStringProviderError
- type DuplicateStructIDError
- type EnvLayer
- type FieldValuesGetter
- type FillerErrors
- type GetError
- type InvalidInputError
- type Layer
- type LayerErrors
- type Layers
- type ModelInterface
- type NamedStringValuesProvider
- type Option
- type OverriddenKeyError
- type ParseError
- type PoliciesGetter
- type StrictCmdlineLayer
- type StrictEnvLayer
- type StrictStringProviderLayer
- type StrictStructLayer
- type StringBasedBuilder
- type StringProviderLayer
- type StringValuesProvider
- type StructBuilder
- type StructLayer
- type UnboundedLocationError
- type UnboundedLocationErrors
Constants ¶
This section is empty.
Variables ¶
var ErrAliasCollision = errors.New("alias collision")
ErrAliasCollision represents an error indicating that an alias is colliding with an actual key in the structure.
var ErrCmdlineAlreadyUsed = errors.New("")
ErrCmdlineAlreadyUsed represent an error where ....
var ErrDuplicateEnvPrefix = errors.New("")
ErrDuplicateEnvPrefix represent an error where ....
var ErrDuplicateInputStruct = errors.New("")
ErrDuplicateInputStruct represent an error where ....
var ErrDuplicateStructID = errors.New("")
ErrDuplicateStructID represent an error where ....
var ErrFiller = errors.New("")
var ErrGet = errors.New("")
var ErrInvalidInput = errors.New("")
ErrCmdlineAlreadyUsed represent an error where ....
var ErrInvalidType = errors.New("invalid type")
ErrInvalidType represent an error where ....
var ErrLayer = errors.New("")
var ErrNilInput = errors.New("nil input")
ErrNilInput is dummy...
var ErrNilProvider = errors.New("nil provider")
ErrNilProvider is shitty...
var ErrNoAliasesProvided = errors.New("no aliases provided")
ErrNoAliasesProvided represent an error where no aliases map was provided with option.
var ErrOverriddenKey = errors.New("overridden key")
ErrOverriddenKey represents an error indicating that a potential key binding wha overridden in another layer.
var ErrParse = errors.New("parse error")
ErrParse represents an error indicating that a value cannot be parsed.
var ErrStructTypeDiffer = errors.New("struct type differ")
ErrStructTypeDiffer represent an error where cannot produce a valid value bases because struct source type and struct type to fillHelper differs.
var ErrUnboundedLocation = errors.New("unbound key")
ErrUnboundedLocation represents an error indicating that a key is never bound to the structure.
Functions ¶
Types ¶
type AliasCollisionError ¶
type AliasCollisionError struct {
Path string
}
func (AliasCollisionError) Error ¶
func (a AliasCollisionError) Error() string
func (AliasCollisionError) Is ¶
func (AliasCollisionError) Is(err error) bool
type AliasesOption ¶
AliasesOption defines keys aliasing.
func WithAliases ¶
func WithAliases(mapping map[string]string) AliasesOption
WithAliases returns a keys aliasing option.
type CmdlineAlreadyUsedError ¶
type CmdlineAlreadyUsedError struct {
Index int
}
func (CmdlineAlreadyUsedError) Error ¶
func (c CmdlineAlreadyUsedError) Error() string
func (CmdlineAlreadyUsedError) Is ¶
func (CmdlineAlreadyUsedError) Is(err error) bool
type CmdlineLayer ¶
type CmdlineLayer struct {
// contains filtered or unexported fields
}
CmdlineLayer is a command line layer.
func WithCmdlineLayer ¶
func WithCmdlineLayer(options ...Option) *CmdlineLayer
WithCmdlineLayer creates a command line layer.
type DuplicateEnvPrefixError ¶
func (DuplicateEnvPrefixError) Error ¶
func (c DuplicateEnvPrefixError) Error() string
func (DuplicateEnvPrefixError) Is ¶
func (DuplicateEnvPrefixError) Is(err error) bool
type DuplicateInputStructError ¶
type DuplicateInputStructError struct {
Index int
}
func (DuplicateInputStructError) Error ¶
func (c DuplicateInputStructError) Error() string
func (DuplicateInputStructError) Is ¶
func (DuplicateInputStructError) Is(err error) bool
type DuplicateStringProviderError ¶
func (DuplicateStringProviderError) Error ¶
func (d DuplicateStringProviderError) Error() string
type DuplicateStructIDError ¶
func (DuplicateStructIDError) Error ¶
func (c DuplicateStructIDError) Error() string
func (DuplicateStructIDError) Is ¶
func (DuplicateStructIDError) Is(err error) bool
type EnvLayer ¶
type EnvLayer struct {
// contains filtered or unexported fields
}
EnvLayer is an environnement variable layer.
func WithEnvLayer ¶
WithEnvLayer creates an environment variable layer.
type FieldValuesGetter ¶
type FieldValuesGetter interface {
GetFieldValuesFrom(model ModelInterface) (fvalue.Values, error)
}
FieldValuesGetter defines the ability to get a path/value set (bases).
type FillerErrors ¶
func (FillerErrors) Is ¶
func (FillerErrors) Is(err error) bool
type InvalidInputError ¶
func (InvalidInputError) Error ¶
func (c InvalidInputError) Error() string
func (InvalidInputError) Is ¶
func (InvalidInputError) Is(err error) bool
type Layer ¶
type Layer interface {
// contains filtered or unexported methods
}
Layer defines a configuration layer.
type LayerErrors ¶
func (LayerErrors) Is ¶
func (LayerErrors) Is(err error) bool
type ModelInterface ¶
type NamedStringValuesProvider ¶
type NamedStringValuesProvider interface { StringValuesProvider GetName() string }
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is processing option for string based binder.
type OverriddenKeyError ¶
func (OverriddenKeyError) Error ¶
func (a OverriddenKeyError) Error() string
func (OverriddenKeyError) Is ¶
func (OverriddenKeyError) Is(err error) bool
type ParseError ¶
func (ParseError) Error ¶
func (a ParseError) Error() string
func (ParseError) Is ¶
func (ParseError) Is(err error) bool
type PoliciesGetter ¶
type PoliciesGetter interface {
GetPolicies() (constraintLayerPolicies, error)
}
type StrictCmdlineLayer ¶
type StrictCmdlineLayer struct {
// contains filtered or unexported fields
}
StrictCmdlineLayer is a strict command line layer.
func WithStrictCmdlineLayer ¶
func WithStrictCmdlineLayer(options ...Option) *StrictCmdlineLayer
WithStrictCmdlineLayer creates a strict command line layer. It can be used only once.
type StrictEnvLayer ¶
type StrictEnvLayer struct {
// contains filtered or unexported fields
}
StrictEnvLayer is a strict environnement variables layer.
func WithStrictEnvLayer ¶
func WithStrictEnvLayer(prefix string, options ...Option) *StrictEnvLayer
WithStrictEnvLayer creates a new strict environment layer.
type StrictStringProviderLayer ¶
type StrictStringProviderLayer struct {
StringProviderLayer
}
func WithStrictStringValueProvider ¶
func WithStrictStringValueProvider( provider NamedStringValuesProvider, options ...Option, ) *StrictStringProviderLayer
type StrictStructLayer ¶
type StrictStructLayer struct {
// contains filtered or unexported fields
}
StrictStructLayer is a strict structure layer.
func WithStrictStructLayer ¶
func WithStrictStructLayer(input any, id string) *StrictStructLayer
WithStrictStructLayer creates a new strict structure layer.
type StringBasedBuilder ¶
type StringBasedBuilder struct {
// contains filtered or unexported fields
}
StringBasedBuilder is a value bases builder depending on text values.
func CmdLine ¶
func CmdLine(options ...Option) ( *StringBasedBuilder, error, )
CmdLine builds a command line manager.
func Env ¶
func Env(prefix string, options ...Option) ( *StringBasedBuilder, error, )
Env builds a env manager.
func NewStringBasedBuilder ¶
func NewStringBasedBuilder( provider StringValuesProvider, options ...Option, ) ( *StringBasedBuilder, error, )
NewStringBasedBuilder creates a bases builder for the provided path/text value set.
func (*StringBasedBuilder) Expand ¶
func (s *StringBasedBuilder) Expand( path string, _type reflect.Type) ( err error, )
func (*StringBasedBuilder) GetFieldValuesFrom ¶
func (s *StringBasedBuilder) GetFieldValuesFrom( model ModelInterface, ) ( fvalue.Values, error, )
GetBaseFor creates the bases.
type StringProviderLayer ¶
type StringProviderLayer struct {
// contains filtered or unexported fields
}
func WithStringValueProvider ¶
func WithStringValueProvider( provider NamedStringValuesProvider, options ...Option, ) *StringProviderLayer
type StringValuesProvider ¶
StringValuesProvider defines the behaviour if a string value provider.
type StructBuilder ¶
type StructBuilder struct {
// contains filtered or unexported fields
}
StructBuilder is a structure layer builder.
func NewStructBuilder ¶
func NewStructBuilder(inputStruct any, id string) (*StructBuilder, error)
NewStructBuilder creates a new structure layer builder.
func (*StructBuilder) GetFieldValuesFrom ¶
func (s *StructBuilder) GetFieldValuesFrom(model ModelInterface) ( fvalue.Values, error, )
type StructLayer ¶
type StructLayer struct {
// contains filtered or unexported fields
}
StructLayer is a structure layer.
func WithStructLayer ¶
func WithStructLayer(input any, id string) *StructLayer
WithStructLayer creates a structure layer.
type UnboundedLocationError ¶
type UnboundedLocationError struct {
Location string
}
func (UnboundedLocationError) Error ¶
func (a UnboundedLocationError) Error() string
func (UnboundedLocationError) Is ¶
func (UnboundedLocationError) Is(err error) bool
type UnboundedLocationErrors ¶
type UnboundedLocationErrors []UnboundedLocationError
func (UnboundedLocationErrors) Len ¶
func (u UnboundedLocationErrors) Len() int
func (UnboundedLocationErrors) Less ¶
func (u UnboundedLocationErrors) Less(i, j int) bool
func (UnboundedLocationErrors) Swap ¶
func (u UnboundedLocationErrors) Swap(i, j int)