Versions in this module Expand all Collapse all v0 v0.0.1 Oct 25, 2025 Changes in this version + type Decision struct + Effect Effect + Error error + ErrorMessage string + Evaluated int + Matched bool + Message string + Policy string + Rule string + type Document struct + DefaultEffect *Effect + Policies []Policy + Version string + func LoadJSONDocument(path string) (Document, error) + func ParseJSONDocument(r io.Reader) (Document, error) + type Effect string + const EffectAllow + const EffectDeny + func (e Effect) IsValid() bool + type Engine struct + func CompileDocument(doc Document, opts ...EngineOption) (*Engine, error) + func CompilePolicies(policies []Policy, opts ...EngineOption) (*Engine, error) + func (e *Engine) Evaluate(_ context.Context, input any) Decision + type EngineOption func(*engineConfig) + func WithDefaultEffect(effect Effect) EngineOption + func WithExprOptions(opts ...expr.Option) EngineOption + func WithSchemaDefinition(schema any) EngineOption + type Policy struct + DefaultEffect *Effect + Description string + Name string + Rules []Rule + Tags []string + type Rule struct + Condition string + Description string + Effect Effect + ID string + Metadata map[string]string