Documentation ¶
Index ¶
- func BuildTraceValueNode(mapContent string) string
- func GenerateTopLevelExpression(exp profile.Rule, iriExpander *misc.IriExpander) string
- func IriExpanderFrom(profile profile.Profile) *misc.IriExpander
- type BranchRegoResult
- type GeneratedRegoResult
- type RegoPathResult
- func GenerateNodeArray(path path.PropertyPath, variable string, iriExpander *misc.IriExpander) RegoPathResult
- func GenerateNodeSet(path path.PropertyPath, variable string, iriExpander *misc.IriExpander) RegoPathResult
- func GeneratePropertyArray(path path.PropertyPath, variable string, iriExpander *misc.IriExpander) RegoPathResult
- func GeneratePropertySet(path path.PropertyPath, variable string, iriExpander *misc.IriExpander) RegoPathResult
- type RegoUnit
- type SimpleRegoResult
- func GenerateClassTarget(variable string, class string, iriExpander *misc.IriExpander) SimpleRegoResult
- func GenerateCount(count profile.CountRule, iriExpander *misc.IriExpander) []SimpleRegoResult
- func GenerateDatatype(datatype profile.DatatypeRule, iriExpander *misc.IriExpander) []SimpleRegoResult
- func GenerateNested(nested profile.NestedExpression, iriExpander *misc.IriExpander) SimpleRegoResult
- func GenerateNumericComparison(num profile.NumericRule, iriExpander *misc.IriExpander) []SimpleRegoResult
- func GeneratePattern(pattern profile.PatternRule, iriExpander *misc.IriExpander) []SimpleRegoResult
- func GeneratePropertyComparison(comparison profile.PropertyComparisonRule, iriExpander *misc.IriExpander) []SimpleRegoResult
- func GenerateRegoRule(rule profile.RegoRule, iriExpander *misc.IriExpander) []SimpleRegoResult
- func GenerateScalarIntersectSetRule(containsSome profile.ScalarSetRule, iriExpander *misc.IriExpander) []SimpleRegoResult
- func GenerateScalarSubSetRule(containsAll profile.ScalarSetRule, iriExpander *misc.IriExpander) []SimpleRegoResult
- func GenerateScalarSuperSetRule(in profile.ScalarSetRule, iriExpander *misc.IriExpander) []SimpleRegoResult
- func GenerateUniqueValues(uniqueValues profile.UniqueValuesRule, iriExpander *misc.IriExpander) []SimpleRegoResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTraceValueNode ¶
func GenerateTopLevelExpression ¶
func GenerateTopLevelExpression(exp profile.Rule, iriExpander *misc.IriExpander) string
func IriExpanderFrom ¶
func IriExpanderFrom(profile profile.Profile) *misc.IriExpander
Types ¶
type BranchRegoResult ¶
type BranchRegoResult struct { Constraint string Branch []SimpleRegoResult }
func GenerateAnd ¶
func GenerateAnd(and profile.AndRule, iriExpander *misc.IriExpander) []BranchRegoResult
Generates code snippets for an AND rule. The result is a set of branches, since we just need one of the predicates to produce an error for the validation to fail, we branch for each clause
func GenerateConditional ¶
func GenerateConditional(conditional profile.ConditionalRule, iriExpander *misc.IriExpander) []BranchRegoResult
func GenerateOr ¶
func GenerateOr(or profile.OrRule, iriExpander *misc.IriExpander) []BranchRegoResult
func (BranchRegoResult) ConstraintId ¶
func (r BranchRegoResult) ConstraintId() string
type GeneratedRegoResult ¶
type GeneratedRegoResult interface {
ConstraintId() string
}
func Dispatch ¶
func Dispatch(r profile.Rule, iriExpander *misc.IriExpander) []GeneratedRegoResult
func GenerateNestedExpression ¶
func GenerateNestedExpression(exp profile.Rule, iriExpander *misc.IriExpander) []GeneratedRegoResult
type RegoPathResult ¶
type RegoPathResult struct {
// contains filtered or unexported fields
}
func GenerateNodeArray ¶
func GenerateNodeArray(path path.PropertyPath, variable string, iriExpander *misc.IriExpander) RegoPathResult
GenerateNodeArray Traverses the path but just returns a generator of nodes instead of an array of values (allows duplicate values)
func GenerateNodeSet ¶
func GenerateNodeSet(path path.PropertyPath, variable string, iriExpander *misc.IriExpander) RegoPathResult
GenerateNodeSet Traverses the path but just returns a generator of nodes instead of a set of values
func GeneratePropertyArray ¶
func GeneratePropertyArray(path path.PropertyPath, variable string, iriExpander *misc.IriExpander) RegoPathResult
GeneratePropertyArray Traversed the path, starting at the provided variable and returns an array of reached values (allows duplicate values)
func GeneratePropertySet ¶
func GeneratePropertySet(path path.PropertyPath, variable string, iriExpander *misc.IriExpander) RegoPathResult
GeneratePropertySet Traversed the path, starting at the provided variable and returns a set of reached values
type RegoUnit ¶
type RegoUnit struct { Name string Entrypoint string Code string Prefixes profile.ProfileContext }
type SimpleRegoResult ¶
type SimpleRegoResult struct { Constraint string // constraint being evaluated Rego []string // rego code with the constraint Path string // path from the parent node to this node Variable string // variable with the result for the next evaluation TraceValue string // evidence value for tracing TraceNode string // trace code PathRules []RegoPathResult //path rules to generate the path rule }
func GenerateClassTarget ¶
func GenerateClassTarget(variable string, class string, iriExpander *misc.IriExpander) SimpleRegoResult
func GenerateCount ¶
func GenerateCount(count profile.CountRule, iriExpander *misc.IriExpander) []SimpleRegoResult
GenerateCount Generates the Rego code snippet for the rule, supports minCount/maxCount and minLength/maxLength
func GenerateDatatype ¶
func GenerateDatatype(datatype profile.DatatypeRule, iriExpander *misc.IriExpander) []SimpleRegoResult
func GenerateNested ¶
func GenerateNested(nested profile.NestedExpression, iriExpander *misc.IriExpander) SimpleRegoResult
func GenerateNumericComparison ¶
func GenerateNumericComparison(num profile.NumericRule, iriExpander *misc.IriExpander) []SimpleRegoResult
func GeneratePattern ¶
func GeneratePattern(pattern profile.PatternRule, iriExpander *misc.IriExpander) []SimpleRegoResult
func GeneratePropertyComparison ¶
func GeneratePropertyComparison(comparison profile.PropertyComparisonRule, iriExpander *misc.IriExpander) []SimpleRegoResult
func GenerateRegoRule ¶
func GenerateRegoRule(rule profile.RegoRule, iriExpander *misc.IriExpander) []SimpleRegoResult
func GenerateScalarIntersectSetRule ¶
func GenerateScalarIntersectSetRule(containsSome profile.ScalarSetRule, iriExpander *misc.IriExpander) []SimpleRegoResult
func GenerateScalarSubSetRule ¶
func GenerateScalarSubSetRule(containsAll profile.ScalarSetRule, iriExpander *misc.IriExpander) []SimpleRegoResult
func GenerateScalarSuperSetRule ¶
func GenerateScalarSuperSetRule(in profile.ScalarSetRule, iriExpander *misc.IriExpander) []SimpleRegoResult
func GenerateUniqueValues ¶
func GenerateUniqueValues(uniqueValues profile.UniqueValuesRule, iriExpander *misc.IriExpander) []SimpleRegoResult
func (SimpleRegoResult) ConstraintId ¶
func (r SimpleRegoResult) ConstraintId() string