Documentation ¶
Index ¶
- func ContainsCondition(a Anchor) bool
- func GetAnchorsResourcesFromMap(patternMap map[string]interface{}) (map[string]interface{}, map[string]interface{})
- func IsAddIfNotPresent(a Anchor) bool
- func IsCondition(a Anchor) bool
- func IsConditionalAnchorError(err error) bool
- func IsEquality(a Anchor) bool
- func IsExistence(a Anchor) bool
- func IsGlobal(a Anchor) bool
- func IsGlobalAnchorError(err error) bool
- func IsNegation(a Anchor) bool
- func IsNegationAnchorError(err error) bool
- func IsOneOf(a Anchor, types ...AnchorType) bool
- func RemoveAnchorsFromPath(str string) string
- func String(modifier AnchorType, key string) string
- type Anchor
- type AnchorMap
- type AnchorType
- type ValidationHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsCondition ¶ added in v1.6.0
ContainsCondition returns true if anchor is either condition anchor or global condition anchor
func GetAnchorsResourcesFromMap ¶ added in v1.1.0
func GetAnchorsResourcesFromMap(patternMap map[string]interface{}) (map[string]interface{}, map[string]interface{})
GetAnchorsResourcesFromMap returns maps of anchors and resources
func IsAddIfNotPresent ¶ added in v1.10.0
IsAddIfNotPresent checks for addition anchor
func IsCondition ¶ added in v1.10.0
IsCondition checks for condition anchor
func IsConditionalAnchorError ¶ added in v1.6.0
IsConditionalAnchorError checks if error is a conditional anchor error
func IsEquality ¶ added in v1.10.0
IsEquality checks for equality anchor
func IsExistence ¶ added in v1.10.0
IsExistence checks for existence anchor
func IsGlobalAnchorError ¶ added in v1.6.0
IsGlobalAnchorError checks if error is a global anchor error
func IsNegation ¶ added in v1.10.0
IsNegation checks for negation anchor
func IsNegationAnchorError ¶ added in v1.6.0
IsNegationAnchorError checks if error is a negation anchor error
func IsOneOf ¶ added in v1.10.0
func IsOneOf(a Anchor, types ...AnchorType) bool
IsOneOf returns checks if anchor is one of the given types
func RemoveAnchorsFromPath ¶ added in v1.6.0
RemoveAnchorsFromPath removes all anchor from path string
func String ¶ added in v1.10.0
func String(modifier AnchorType, key string) string
String returns the anchor string. Will return an empty string if key is empty.
Types ¶
type Anchor ¶ added in v1.10.0
type Anchor interface { // Type returns the anchor type Type() AnchorType // Key returns the anchor key Key() string // String returns the anchor string String() string }
Anchor interface
type AnchorMap ¶ added in v1.10.0
type AnchorMap struct { // AnchorError - used in validate to break execution of the recursion when if condition fails AnchorError validateAnchorError // contains filtered or unexported fields }
AnchorMap - contains map of anchors
func NewAnchorMap ¶ added in v1.6.0
func NewAnchorMap() *AnchorMap
NewAnchorMap -initialize anchorMap
func (*AnchorMap) CheckAnchorInResource ¶ added in v1.10.0
CheckAnchorInResource checks if condition anchor key has values
func (*AnchorMap) KeysAreMissing ¶ added in v1.10.0
KeysAreMissing - if any of the anchor key doesn't exists in the resource then it will return true if any of (key)=false then return KeysAreMissing() as true if all the keys exists in the pattern exists in resource then return KeysAreMissing() as false
type AnchorType ¶ added in v1.10.0
type AnchorType string
const ( Condition AnchorType = "" Global AnchorType = "<" Negation AnchorType = "X" AddIfNotPresent AnchorType = "+" Equality AnchorType = "=" Existence AnchorType = "^" )
type ValidationHandler ¶ added in v1.1.0
type ValidationHandler interface { Handle( handler resourceElementHandler, resourceMap map[string]interface{}, originPattern interface{}, ac *AnchorMap, ) (string, error) }
ValidationHandler for element processes
func CreateElementHandler ¶ added in v1.1.0
func CreateElementHandler(element string, pattern interface{}, path string) ValidationHandler
CreateElementHandler factory to process elements