Documentation ¶
Index ¶
- func CustomDereferenceCleaner(f DereferenceCleaner) func(*basicResolver)
- func GetResolverInfo(toResolve string) (string, int)
- func IsResolveExpr(exprStr string) bool
- func NoDereferencing(r *basicResolver)
- type CompositeResolver
- type DereferenceCleaner
- type EnvResolver
- type LoopResolver
- type PropertyResolver
- type Resolution
- type ResolveDirectiveDetails
- type Resolver
- type ResolverInfo
- type ScopeResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CustomDereferenceCleaner ¶
func CustomDereferenceCleaner(f DereferenceCleaner) func(*basicResolver)
func GetResolverInfo ¶
GetResolverInfo gets the resolver name and position to start parsing the ResolutionDetails from
func IsResolveExpr ¶
IsResolveExpr determines if the provide expression string is a resolver expression, ie. "$env[MY_VAR]
func NoDereferencing ¶
func NoDereferencing(r *basicResolver)
Types ¶
type CompositeResolver ¶
type CompositeResolver interface { // GetResolution creates a "delayed" resolution object, who's value isn't fully resolved // util GetValue is called GetResolution(resolveDirective string) (Resolution, error) // Resolve resolves to a value using the specified directive Resolve(resolveDirective string, scope data.Scope) (value interface{}, err error) }
CompositeResolver is a resolver that is typically composed of other simple 'Resolvers', the specified directive is dispatched to the appropriate embedded resolvers
func GetBasicResolver ¶
func GetBasicResolver() CompositeResolver
func NewCompositeResolver ¶
func NewCompositeResolver(resolvers map[string]Resolver, options ...func(r *basicResolver)) CompositeResolver
type DereferenceCleaner ¶
DereferenceCleaner removes the dereference characters from the resolve directive
type EnvResolver ¶
type EnvResolver struct { }
func (*EnvResolver) GetResolverInfo ¶
func (*EnvResolver) GetResolverInfo() *ResolverInfo
type LoopResolver ¶
type LoopResolver struct { }
func (*LoopResolver) GetResolverInfo ¶
func (*LoopResolver) GetResolverInfo() *ResolverInfo
type PropertyResolver ¶
type PropertyResolver struct { }
DEPRECATED
func (*PropertyResolver) GetResolverInfo ¶
func (*PropertyResolver) GetResolverInfo() *ResolverInfo
type Resolution ¶
type Resolution interface { // IsStatic indicates that resolution can be done statically without a scope IsStatic() bool // GetValue resolves and returns the value using the specified scope GetValue(scope data.Scope) (interface{}, error) }
Resolution structure that is allows for delayed resolving of values, the value can then be fully resolved calling GetValue for a particular scope
type ResolveDirectiveDetails ¶
ResolveDirectiveDetails is the Resolve Directive broken into components to assist in resolving the value
func GetResolveDirectiveDetails ¶
func GetResolveDirectiveDetails(directive string, hasItems, isImplicit bool) (*ResolveDirectiveDetails, error)
GetResolveDirectiveDetails breaks Resolution Directive into components
type Resolver ¶
type Resolver interface { // GetResolverInfo returns ResolverInfo which contains information about the resolver GetResolverInfo() *ResolverInfo // Resolve resolves to a value using the specified item and valueName, note: the scope might not be used Resolve(scope data.Scope, itemName, valueName string) (interface{}, error) }
Resolver is for resolving a value for a specific environment or construct, ex. OS environment
type ResolverInfo ¶
type ResolverInfo struct {
// contains filtered or unexported fields
}
ResolverInfo structure that contains information about the resolver
func NewImplicitResolverInfo ¶
func NewImplicitResolverInfo(isStatic, isImplicit bool) *ResolverInfo
func NewResolverInfo ¶
func NewResolverInfo(isStatic, usesItemFormat bool) *ResolverInfo
NewResolverInfo creates a ResolverInfo object
func (*ResolverInfo) IsImplicit ¶
func (i *ResolverInfo) IsImplicit() bool
IsImplicit determines if the resolver try to uses the item format and no item format then
func (*ResolverInfo) IsStatic ¶
func (i *ResolverInfo) IsStatic() bool
IsStatic determines if the resolver's values are static and can be resolved immediately without a scope
func (*ResolverInfo) UsesItemFormat ¶
func (i *ResolverInfo) UsesItemFormat() bool
UsesItemFormat determines if the resolver uses the item format (ex. $test[itemName])
type ScopeResolver ¶
type ScopeResolver struct { }
func (*ScopeResolver) GetResolverInfo ¶
func (*ScopeResolver) GetResolverInfo() *ResolverInfo