Documentation
¶
Index ¶
- Variables
- func AddDocument(key string, jsonData string) bool
- func AddPolicy(key string, regoStr string) bool
- func AnalyzeResult(response string) (bool, error)
- func ConvertToRegoRule(rule *share.CLUSAdmissionRule) string
- func DeleteDocument(key string)
- func DeletePolicy(ruleId uint32)
- func InitOpaServer()
- func IsOpaRestarted() bool
- func OpaEval(policyPath string, inputFile string) (int, string, error)
- func OpaEvalByString(policyPath string, inputData string) (int, string, error)
- func RestoreOpaData()
- func StartOpaServer() *exec.Cmd
- type EvaluationResultSpec
- type EvaluationResultV1
- type OpaEvalResultSpec
- type OpaEvalResultV1
- type RegoResultEntryV1
- type RegoSpecification
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ContentTypeJson = "application/json; charset=utf-8" ContentTypeText = "text/plain; charset=utf-8" )
Functions ¶
func AddDocument ¶
func AnalyzeResult ¶
this function should return matched or not needs to return same information as we need in NeuVector controller webhook..
func ConvertToRegoRule ¶
func ConvertToRegoRule(rule *share.CLUSAdmissionRule) string
func DeleteDocument ¶
func DeleteDocument(key string)
func DeletePolicy ¶
func DeletePolicy(ruleId uint32)
func InitOpaServer ¶
func InitOpaServer()
func IsOpaRestarted ¶
func IsOpaRestarted() bool
func OpaEvalByString ¶
func RestoreOpaData ¶
func RestoreOpaData()
func StartOpaServer ¶
Types ¶
type EvaluationResultSpec ¶
type EvaluationResultSpec struct {
Spec RegoSpecification `json:"specification"`
}
type EvaluationResultV1 ¶
type EvaluationResultV1 struct { Violations []RegoResultEntryV1 `json:"violation"` ViolationMsgs []string `json:"violationmsgs"` Spec RegoSpecification `json:"specification"` }
for spec.Version=="v1"
type OpaEvalResultSpec ¶
type OpaEvalResultSpec struct {
Result EvaluationResultSpec `json:"result"`
}
type OpaEvalResultV1 ¶
type OpaEvalResultV1 struct {
Result EvaluationResultV1 `json:"result"`
}
type RegoResultEntryV1 ¶
type RegoSpecification ¶
Click to show internal directories.
Click to hide internal directories.