Documentation ¶
Index ¶
- Variables
- func CopyMap(m map[string]interface{}) map[string]interface{}
- func CopySlice(s []interface{}) []interface{}
- func CopySliceOfMaps(s []map[string]interface{}) []interface{}
- func IsConditionalAnchorError(msg string) bool
- func IsGlobalAnchorError(msg string) bool
- func ToMap(data interface{}) (map[string]interface{}, error)
- type AnchorError
- type AnchorKey
- type ValidateAnchorError
Constants ¶
This section is empty.
Variables ¶
var ConditionalAnchorErrMsg = "conditional anchor mismatch"
ConditionalAnchorErrMsg - the error message for conditional anchor error
var GlobalAnchorErrMsg = "global anchor mismatch"
GlobalAnchorErrMsg - the error message for global anchor error
Functions ¶
func CopySlice ¶ added in v1.3.5
func CopySlice(s []interface{}) []interface{}
CopySlice creates a full copy of the target slice
func CopySliceOfMaps ¶ added in v1.5.0
func CopySliceOfMaps(s []map[string]interface{}) []interface{}
CopySliceOfMaps creates a full copy of the target slice
func IsConditionalAnchorError ¶ added in v1.3.0
IsConditionalAnchorError checks if error message has conditional anchor error string
func IsGlobalAnchorError ¶ added in v1.4.3
IsGlobalAnchorError checks if error message has global anchor error string
Types ¶
type AnchorError ¶ added in v1.3.0
type AnchorError int
AnchorError is the const specification of anchor errors
const ( // ConditionalAnchorErr refers to condition violation ConditionalAnchorErr AnchorError = iota // GlobalAnchorErr refers to global condition violation GlobalAnchorErr )
type AnchorKey ¶
type AnchorKey struct { // AnchorError - used in validate to break execution of the recursion when if condition fails AnchorError ValidateAnchorError // contains filtered or unexported fields }
AnchorKey - contains map of anchors
func (*AnchorKey) CheckAnchorInResource ¶
func (ac *AnchorKey) CheckAnchorInResource(pattern interface{}, resource interface{})
CheckAnchorInResource checks if condition anchor key has values
func (*AnchorKey) IsAnchorError ¶
IsAnchorError - if any of the anchor key doesn't exists in the resource then it will return true if any of (key)=false then return IsAnchorError() as true if all the keys exists in the pattern exists in resource then return IsAnchorError() as false
type ValidateAnchorError ¶ added in v1.3.0
type ValidateAnchorError struct { Err AnchorError Message string }
ValidateAnchorError represents the error type of validation anchors
func NewConditionalAnchorError ¶ added in v1.3.0
func NewConditionalAnchorError(msg string) ValidateAnchorError
NewConditionalAnchorError returns a new instance of ConditionalAnchorError
func NewGlobalAnchorError ¶ added in v1.4.3
func NewGlobalAnchorError(msg string) ValidateAnchorError
NewGlobalAnchorError returns a new instance of GlobalAnchorError
func (ValidateAnchorError) Error ¶ added in v1.3.0
func (e ValidateAnchorError) Error() error
func (ValidateAnchorError) IsConditionAnchorError ¶ added in v1.3.0
func (e ValidateAnchorError) IsConditionAnchorError() bool
IsConditionAnchorError ...
func (ValidateAnchorError) IsGlobalAnchorError ¶ added in v1.4.3
func (e ValidateAnchorError) IsGlobalAnchorError() bool
IsConditionAnchorError ...
func (ValidateAnchorError) IsNil ¶ added in v1.3.0
func (e ValidateAnchorError) IsNil() bool
IsNil ...