common

package
v1.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConditionalAnchorErrMsg = "conditionalAnchorError"

ConditionalAnchorErrMsg - the error message for conditional anchor error

Functions

func CopyMap added in v1.3.5

func CopyMap(m map[string]interface{}) map[string]interface{}

CopyMap creates a full copy of the target map

func CopySlice added in v1.3.5

func CopySlice(s []interface{}) []interface{}

CopySlice creates a full copy of the target slice

func IsConditionalAnchorError added in v1.3.0

func IsConditionalAnchorError(msg string) bool

IsConditionalAnchorError checks if error message has conditional anchor error string

Types

type AnchorError added in v1.3.0

type AnchorError int

AnchorError is the const specification of anchor errors

const ConditionalAnchorErr AnchorError = iota

ConditionalAnchorErr ...

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 NewAnchorMap

func NewAnchorMap() *AnchorKey

NewAnchorMap -initialize anchorMap

func (*AnchorKey) CheckAnchorInResource

func (ac *AnchorKey) CheckAnchorInResource(pattern interface{}, resource interface{})

CheckAnchorInResource checks if condition anchor key has values

func (*AnchorKey) IsAnchorError

func (ac *AnchorKey) IsAnchorError() bool

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 (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) IsNil added in v1.3.0

func (e ValidateAnchorError) IsNil() bool

IsNil ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL