Documentation
      ¶
    
    
  
    
  
    Index ¶
- func GenReset()
 - func Genvar(hint string) string
 - func Indent(s string) string
 - func IndentArray(ss []string) []string
 - type AndRule
 - type AtomicStatement
 - type BaseStatement
 - type CardinalityOperation
 - type ComplexStatement
 - type ConditionalRule
 - func (r ConditionalRule) ElseIsDefined() bool
 - func (r ConditionalRule) ElseMaterialImplication() OrRule
 - func (r ConditionalRule) ElseRule() Rule
 - func (r ConditionalRule) IfRule() Rule
 - func (r ConditionalRule) Negate() Rule
 - func (r ConditionalRule) String() string
 - func (r ConditionalRule) ThenMaterialImplication() OrRule
 - func (r ConditionalRule) ThenRule() Rule
 
- type CountQualifier
 - type CountRule
 - type DatatypeRule
 - type Expression
 - type Message
 - type NestedExpression
 - type NumericRule
 - type OrRule
 - type PatternRule
 - type Profile
 - type ProfileContext
 - type PropertyComparisonRule
 - type Quantification
 - type RegoRule
 - type Rule
 - func ParseConstraint(path pathParser.PropertyPath, variable Variable, constraint *y.Yaml, ...) ([]Rule, error)
 - func ParseExpression(name string, data *y.Yaml, level string, varGenerator *VarGenerator) (Rule, error)
 - func ParseRego(code *y.Yaml, negated bool, variable Variable, path pathParser.PropertyPath) (Rule, error)
 
- type RuleSlice
 - type ScalarSetRule
 - type SetCriteria
 - type TargetValue
 - type TopLevelExpression
 - type UniqueValuesRule
 - type VarGenerator
 - type Variable
 - type VariableCardinality
 
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IndentArray ¶
Types ¶
type AndRule ¶
type AndRule ComplexStatement
type AtomicStatement ¶
type AtomicStatement struct {
	BaseStatement
	Variable Variable
	Path     path.PropertyPath
}
    type BaseStatement ¶
type CardinalityOperation ¶
type CardinalityOperation int
const ( LTEQ CardinalityOperation = iota LT EQ NEQ GT GTEQ )
func (CardinalityOperation) String ¶
func (op CardinalityOperation) String() string
type ComplexStatement ¶
type ComplexStatement struct {
	BaseStatement
	Body RuleSlice
}
    type ConditionalRule ¶
type ConditionalRule ComplexStatement
func NewConditional ¶
func NewConditional(negated bool, ifRule Rule, thenRule Rule) ConditionalRule
func NewIfThenElseConditional ¶
func NewIfThenElseConditional(negated bool, ifRule Rule, thenRule Rule, elseRule Rule) ConditionalRule
func (ConditionalRule) ElseIsDefined ¶
func (r ConditionalRule) ElseIsDefined() bool
func (ConditionalRule) ElseMaterialImplication ¶
func (r ConditionalRule) ElseMaterialImplication() OrRule
¬ifRule -> elseRule <==> ifRule ∨ thenRule
func (ConditionalRule) ElseRule ¶
func (r ConditionalRule) ElseRule() Rule
func (ConditionalRule) IfRule ¶
func (r ConditionalRule) IfRule() Rule
func (ConditionalRule) Negate ¶
func (r ConditionalRule) Negate() Rule
func (ConditionalRule) String ¶
func (r ConditionalRule) String() string
func (ConditionalRule) ThenMaterialImplication ¶
func (r ConditionalRule) ThenMaterialImplication() OrRule
ifRule -> thenRule <==> ¬ifRule ∨ thenRule
func (ConditionalRule) ThenRule ¶
func (r ConditionalRule) ThenRule() Rule
type CountRule ¶
type CountRule struct {
	AtomicStatement
	Qualifier CountQualifier
	Target    TargetValue
	Argument  int
}
    type DatatypeRule ¶
type DatatypeRule struct {
	AtomicStatement
	Argument string
}
    func (DatatypeRule) Negate ¶
func (r DatatypeRule) Negate() Rule
func (DatatypeRule) String ¶
func (r DatatypeRule) String() string
type Expression ¶
type Expression struct {
	BaseStatement
	Variable *Variable
	Value    Rule
}
    func (Expression) Negate ¶
func (exp Expression) Negate() Rule
func (Expression) String ¶
func (exp Expression) String() string
type Message ¶ added in v1.3.0
func ParseMessageExpression ¶ added in v1.3.0
type NestedExpression ¶
type NestedExpression struct {
	BaseStatement
	Path   path.PropertyPath
	Parent Variable
	Child  Variable
	Value  Rule
}
    func (NestedExpression) Negate ¶
func (exp NestedExpression) Negate() Rule
func (NestedExpression) String ¶
func (exp NestedExpression) String() string
type NumericRule ¶
type NumericRule struct {
	AtomicStatement
	Operation CardinalityOperation
	Argument  *y.Yaml
}
    func (NumericRule) FloatArgument ¶
func (r NumericRule) FloatArgument() (float64, error)
func (NumericRule) IntArgument ¶
func (r NumericRule) IntArgument() (int, error)
func (NumericRule) Negate ¶
func (r NumericRule) Negate() Rule
func (NumericRule) String ¶
func (r NumericRule) String() string
func (NumericRule) StringArgument ¶
func (r NumericRule) StringArgument() string
type OrRule ¶
type OrRule ComplexStatement
type PatternRule ¶
type PatternRule struct {
	AtomicStatement
	Argument string
}
    func (PatternRule) Negate ¶
func (r PatternRule) Negate() Rule
func (PatternRule) String ¶
func (r PatternRule) String() string
type Profile ¶
type Profile struct {
	Name        string
	Description *string
	CustomRego  *string
	Prefixes    ProfileContext
	Violation   []Rule
	Warning     []Rule
	Info        []Rule
}
    func NewProfile ¶
func NewProfile() Profile
type ProfileContext ¶
func ParsePrefixes ¶
func ParsePrefixes(y *y.Yaml) (ProfileContext, error)
Captures the aliases and JSON-LD URI prefix for the profile
type PropertyComparisonRule ¶
type PropertyComparisonRule struct {
	AtomicStatement
	Operator CardinalityOperation
	Argument path.PropertyPath
}
    func (PropertyComparisonRule) Negate ¶
func (r PropertyComparisonRule) Negate() Rule
func (PropertyComparisonRule) String ¶
func (r PropertyComparisonRule) String() string
type RegoRule ¶
type RegoRule struct {
	AtomicStatement
	Message  string
	Argument string
}
    type Rule ¶
func ParseConstraint ¶
func ParseConstraint(path pathParser.PropertyPath, variable Variable, constraint *y.Yaml, varGenerator *VarGenerator) ([]Rule, error)
func ParseExpression ¶
func ParseRego ¶
func ParseRego(code *y.Yaml, negated bool, variable Variable, path pathParser.PropertyPath) (Rule, error)
type ScalarSetRule ¶
type ScalarSetRule struct {
	AtomicStatement
	Argument []string
	SetCriteria
}
    func (ScalarSetRule) JSONValues ¶
func (r ScalarSetRule) JSONValues() string
func (ScalarSetRule) Negate ¶
func (r ScalarSetRule) Negate() Rule
func (ScalarSetRule) String ¶
func (r ScalarSetRule) String() string
type SetCriteria ¶
type SetCriteria int
const ( SuperSet SetCriteria = iota // in SubSet // containsAll InsersectSet // containsSome )
type TopLevelExpression ¶
type TopLevelExpression struct {
	Expression
	Message        Message
	Level          string
	ClassGenerator string
}
    func (TopLevelExpression) Negate ¶
func (exp TopLevelExpression) Negate() Rule
func (TopLevelExpression) String ¶
func (exp TopLevelExpression) String() string
type UniqueValuesRule ¶
type UniqueValuesRule struct {
	AtomicStatement
	Argument bool
}
    func (UniqueValuesRule) Negate ¶
func (r UniqueValuesRule) Negate() Rule
func (UniqueValuesRule) String ¶
func (r UniqueValuesRule) String() string
type VarGenerator ¶
type VarGenerator struct {
	// contains filtered or unexported fields
}
    func NewVarGenerator ¶
func NewVarGenerator() VarGenerator
func (*VarGenerator) GenExpressionVar ¶
func (g *VarGenerator) GenExpressionVar(quantification Quantification, cardinality *VariableCardinality) Variable
type Variable ¶
type Variable struct {
	Quantification Quantification
	Name           string
	Cardinality    *VariableCardinality
}
    type VariableCardinality ¶
type VariableCardinality struct {
	Operator CardinalityOperation
	Value    int
}
    func (VariableCardinality) RuleName ¶
func (c VariableCardinality) RuleName() string
func (VariableCardinality) String ¶
func (c VariableCardinality) String() string
      
      Source Files
      ¶
    
   Click to show internal directories. 
   Click to hide internal directories.