Documentation
¶
Index ¶
- func AppendComment(comment1 string, comment2 string) string
- func EvalPolicy(rawFile *[]byte, regoNamespace string, policyPath string) rego.ResultSet
- func ExecuteMandatoryRule(rawFile *[]byte, queryResult rego.ResultSet) *[]byte
- func ExecuteOptionalRule(rawFile *[]byte, queryResult rego.ResultSet) *[]byte
- func ExecuteProhibitedRule(rawFile *[]byte, queryResult rego.ResultSet) *[]byte
- func ExecuteRule(rawFile *[]byte, hints []interface{}, ...) *[]byte
- func ExtractRuleResult(queryResult rego.ResultSet, ruleName string) []interface{}
- func FindElements(yamlNode *yaml.Node, path string) []*yaml.Node
- func NewRegoObject(regoNamespace string, policyPath string) (*rego.PreparedEvalQuery, context.Context)
- func ParseConfiguration(rawFile *[]byte) map[string]interface{}
- func ReadFile(path string) *[]byte
- func WriteFile(filename string, data *[]byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendComment ¶
concat two comments
func EvalPolicy ¶
given raw bytes of a YAML file apply Rego query on it return rego result set
func ExecuteMandatoryRule ¶
given raw byte data of a YAML, decision results returned by OPA append YAML template under specified key and add comments to YAML nodes return raw byte data of a updated YAML
func ExecuteOptionalRule ¶
given raw byte data of a YAML, decision results returned by OPA append comments to YAML nodes return raw byte data of a updated YAML
func ExecuteProhibitedRule ¶
given raw byte data of a YAML, decision results returned by OPA remove prohibited YAML nodes and append comments to YAML nodes return raw byte data of a updated YAML
func ExecuteRule ¶
func ExecuteRule(rawFile *[]byte, hints []interface{}, handleFunc func(*yaml.Node, map[string]interface{})) *[]byte
given raw byte data of a YAML, rule result set as hints and function to apply rules apply rules to a YAML file return raw byte data of a updated YAML
func ExtractRuleResult ¶
given OPA query result set, extracts the result set from rule execution return extracted result set
func FindElements ¶
func FindElements(yamlNode *yaml.Node, path string) []*yaml.Node
find corresponding YAML Nodes based on a JSONPath query return found Nodes in a YAML Node tree
func NewRegoObject ¶
func NewRegoObject(regoNamespace string, policyPath string) (*rego.PreparedEvalQuery, context.Context)
given rego pacakge name and folder path where policies are located return a Rego query object which is ready for execution
func ParseConfiguration ¶
parse raw byte data of a file to Golang variables return sturctured data
Types ¶
This section is empty.