Documentation ¶
Overview ¶
Deprecated: This package is intended for older projects transitioning from OPA v0.x and will remain for the lifetime of OPA v1.x, but its use is not recommended. For newer features and behaviours, such as defaulting to the Rego v1 syntax, use the corresponding components in the github.com/open-policy-agent/opa/v1 package instead. See https://www.openpolicyagent.org/docs/latest/v0-compatibility/ for more information.
Index ¶
- Constants
- func DecisionIDFromContext(ctx context.Context) (string, bool)
- func NewContext(parent context.Context, val *RequestContext) context.Context
- func WithDecisionID(parent context.Context, id string) context.Context
- func WithHTTPRequestContext(parent context.Context, val *HTTPRequestContext) context.Context
- type HTTPRequestContext
- type Level
- type Logger
- type NoOpLogger
- type RequestContext
- type StandardLogger
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func DecisionIDFromContext ¶ added in v0.50.0
func NewContext ¶ added in v0.46.0
func NewContext(parent context.Context, val *RequestContext) context.Context
NewContext returns a copy of parent with an associated RequestContext.
func WithDecisionID ¶ added in v0.50.0
func WithHTTPRequestContext ¶ added in v0.68.0
func WithHTTPRequestContext(parent context.Context, val *HTTPRequestContext) context.Context
Types ¶
type HTTPRequestContext ¶ added in v0.65.0
type HTTPRequestContext = v1.HTTPRequestContext
func HTTPRequestContextFromContext ¶ added in v0.68.0
func HTTPRequestContextFromContext(ctx context.Context) (*HTTPRequestContext, bool)
type NoOpLogger ¶
type NoOpLogger = v1.NoOpLogger
NoOpLogger logging implementation that does nothing
type RequestContext ¶ added in v0.46.0
type RequestContext = v1.RequestContext
RequestContext represents the request context used to store data related to the request that could be used on logs.
func FromContext ¶ added in v0.46.0
func FromContext(ctx context.Context) (*RequestContext, bool)
FromContext returns the RequestContext associated with ctx, if any.
type StandardLogger ¶
type StandardLogger = v1.StandardLogger
StandardLogger is the default OPA logger implementation.
func Get ¶ added in v0.31.0
func Get() *StandardLogger
Get returns the standard logger used throughout OPA.
Deprecated. Do not rely on the global logger.
Directories ¶
Path | Synopsis |
---|---|
Deprecated: This package is intended for older projects transitioning from OPA v0.x and will remain for the lifetime of OPA v1.x, but its use is not recommended.
|
Deprecated: This package is intended for older projects transitioning from OPA v0.x and will remain for the lifetime of OPA v1.x, but its use is not recommended. |