Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Policy ¶
type Policy interface { // Reload will reload the policy. Subsequent calls to Evaluate will run // the newly loaded policy, if reloading was successful. If reloading fails, // the old state is kept. Reload() error // Evaluate the underlying policy. See rego docs for more info. Eval(ctx context.Context, options ...rego.EvalOption) (rego.ResultSet, error) }
Policy wraps a OPA policy and supports reloading at runtime.
func LoadFromFile ¶
LoadFromFile creates a reloadable policy from a rego file.
func WrapForTest ¶
func WrapForTest(query *rego.PreparedEvalQuery) Policy
WrapForTest creates a policy from a pepared query, useful for testing. Do not use this in code -- the policy will not be able to reload.
Click to show internal directories.
Click to hide internal directories.