Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrSourceDenied is returned by the policy engine when a source is denied by the policy. ErrSourceDenied = errors.New("source denied by policy") // ErrTooManyOps is returned by the policy engine when there are too many converts for a single source op. ErrTooManyOps = errors.New("too many operations") )
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is the source policy engine. It is responsible for evaluating a source policy against a source operation. Create one with `NewEngine`
Rule matching is delegated to the `Matcher` interface. Mutations are delegated to the `Mutater` interface.
func (*Engine) Evaluate ¶
Evaluate evaluates a source operation against the policy.
Policies are re-evaluated for each convert rule. Evaluate will error if the there are too many converts for a single source op to prevent infinite loops. This function may error out even if the op was mutated, in which case `true` will be returned along with the error.
An error is returned when the source is denied by the policy.
Click to show internal directories.
Click to hide internal directories.