package
1.2.0
Repository: https://github.com/open-policy-agent/opa.git
Documentation: pkg.go.dev

# Packages

Package builtins contains utilities for implementing built-in functions.
Package cache defines the inter-query cache interface that can cache data across queries.

# Functions

GetBuiltin returns a built-in function implementation, nil if no built-in found.
IsCancel returns true if err was caused by cancellation.
IsError returns true if the err is an Error.
NewBufferTracer returns a new BufferTracer.
NewCancel returns a new Cancel object.
NewInstrumentation returns a new Instrumentation object.
NewQuery returns a new Query object that can be run.
PrettyTrace pretty prints the trace to the writer.
PrettyTraceWithLocation prints the trace to the writer and includes location information.
RegisterBuiltinFunc adds a new built-in function to the evaluation engine.
Deprecated: Functional-style builtins are deprecated.
Deprecated: Functional-style builtins are deprecated.
Deprecated: Functional-style builtins are deprecated.
Deprecated: Functional-style builtins are deprecated.
WrapLegacyTracer will create a new QueryTracer which wraps an older Tracer instance.

# Constants

BuiltinErr indicates a built-in function received a semantically invalid input or encountered some kind of runtime error, e.g., connection timeout, connection refused, etc.
CancelErr indicates the evaluation process was cancelled.
ConflictErr indicates a conflict was encountered during evaluation.
DuplicateOp is emitted when a query has produced a duplicate value.
EnterOp is emitted when a new query is about to be evaluated.
EvalOp is emitted when an expression is about to be evaluated.
ExitOp is emitted when a query has evaluated to true.
FailOp is emitted when an expression evaluates to false.
HTTPSendInternalErr represents a runtime evaluation error.
HTTPSendNetworkErr represents a network error.
IndexOp is emitted during an expression evaluation to represent lookup matches.
InternalErr represents an unknown evaluation error.
NoteOp is emitted when an expression invokes a tracing built-in function.
RedoOp is emitted when an expression, rule, or query is being re-evaluated.
SaveOp is emitted when an expression is saved instead of evaluated during partial evaluation.
TypeErr indicates evaluation stopped because an expression was applied to a value of an inappropriate type.
UnifyOp is emitted when two terms are unified.
WasmOp is emitted when resolving a ref using an external Resolver.
WithMergeErr indicates that the real and replacement data could not be merged.

# Structs

Builtin represents a built-in function that queries can call.
Deprecated: The BuiltinEmpty type is no longer needed.
Error is the error type returned by the Eval and Query functions when an evaluation error occurs.
Event contains state associated with a tracing event.
Halt is a special error type that built-in function implementations return to indicate that policy evaluation should stop immediately.
Instrumentation implements helper functions to instrument query evaluation to diagnose performance issues.
JSONWebToken represent the 3 parts (header, payload & signature) of a JWT in Base64.
Query provides a configurable interface for performing query evaluation.
TraceConfig defines some common configuration for Tracer implementations.
VarMetadata provides some user facing information about a variable in some policy.

# Interfaces

BaseCache defines the interface for a cache that stores cached base documents, i.e.
Cancel defines the interface for cancelling topdown queries.
QueryTracer defines the interface for tracing in the top-down evaluation engine.
Tracer defines the interface for tracing in the top-down evaluation engine.
VirtualCache defines the interface for a cache that stores the results of evaluated virtual documents (rules).

# Type aliases

BufferTracer implements the Tracer and QueryTracer interface by simply buffering all events received.
CustomizeRoundTripper allows customizing an existing http.Transport, to the returned value, which could be the same Transport or a new one.
Op defines the types of tracing events.
QueryResult represents a single result returned by a query.
QueryResultSet represents a collection of results returned by a query.