Documentation ¶
Index ¶
- Variables
- type Driver
- func (d *Driver) AddConstraint(_ context.Context, constraint *unstructured.Unstructured) error
- func (d *Driver) AddData(_ context.Context, _ string, _ storage.Path, _ interface{}) error
- func (d *Driver) AddTemplate(_ context.Context, ct *templates.ConstraintTemplate) error
- func (d *Driver) Dump(_ context.Context) (string, error)
- func (d *Driver) GetConstraintsForTemplate(template *templates.ConstraintTemplate) map[string]*unstructured.Unstructured
- func (d *Driver) GetDescriptionForStat(_ string) (string, error)
- func (d *Driver) GetTemplateCode() map[string]string
- func (d *Driver) Name() string
- func (d *Driver) Query(_ context.Context, _ string, constraints []*unstructured.Unstructured, ...) (*drivers.QueryResponse, error)
- func (d *Driver) RemoveConstraint(_ context.Context, constraint *unstructured.Unstructured) error
- func (d *Driver) RemoveData(_ context.Context, _ string, _ storage.Path) error
- func (d *Driver) RemoveTemplate(_ context.Context, ct *templates.ConstraintTemplate) error
- func (d *Driver) SetErrOnAddConstraint(raiseErr bool)
- func (d *Driver) SetErrOnAddTemplate(raiseErr bool)
- func (d *Driver) SetErrOnRemoveConstraint(raiseErr bool)
- func (d *Driver) SetErrOnRemoveTemplate(raiseErr bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTesting = errors.New("test error")
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver is a threadsafe Rego environment for compiling Rego in ConstraintTemplates, registering Constraints, and executing queries.
func (*Driver) AddConstraint ¶
func (d *Driver) AddConstraint(_ context.Context, constraint *unstructured.Unstructured) error
AddConstraint adds Constraint to storage. Used to validate state in tests.
func (*Driver) AddTemplate ¶
AddTemplate adds templ to Driver. Normalizes modules into usable forms for use in queries.
func (*Driver) GetConstraintsForTemplate ¶
func (d *Driver) GetConstraintsForTemplate(template *templates.ConstraintTemplate) map[string]*unstructured.Unstructured
func (*Driver) GetDescriptionForStat ¶
func (*Driver) GetTemplateCode ¶
func (*Driver) Query ¶
func (d *Driver) Query(_ context.Context, _ string, constraints []*unstructured.Unstructured, _ interface{}, _ ...reviews.ReviewOpt) (*drivers.QueryResponse, error)
func (*Driver) RemoveConstraint ¶
func (d *Driver) RemoveConstraint(_ context.Context, constraint *unstructured.Unstructured) error
RemoveConstraint removes Constraint from Rego storage. Used to validate state in tests.
func (*Driver) RemoveData ¶
RemoveData should not be a thing that drivers handle.
func (*Driver) RemoveTemplate ¶
RemoveTemplate removes all Compilers and Constraints for templ. Returns nil if templ does not exist.
func (*Driver) SetErrOnAddConstraint ¶
func (*Driver) SetErrOnAddTemplate ¶
func (*Driver) SetErrOnRemoveConstraint ¶
func (*Driver) SetErrOnRemoveTemplate ¶
Click to show internal directories.
Click to hide internal directories.