Files
releases/server/buffer.go
T
Torin Sandall 4033f3d945 server: Remove deprecated diagnostic feature
This commit removes the deprecated diagnostic feature from the
server. The feature has been deprecated since November 2018 and it was
essentially unused at the time so it should be safe to
remove. Removing the diagnostic support from the server saves having
to perform an extra policy evaluation in the server.

Once the buffer is removed from the runtime.Params struct the related
issue can be closed (there is still one known user of that so it has
been left intact for backwards compatibility.)

Ref #1052

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2019-08-06 02:25:09 +09:00

47 lines
1.1 KiB
Go

// Copyright 2017 The OPA Authors. All rights reserved.
// Use of this source code is governed by an Apache2
// license that can be found in the LICENSE file.
package server
import (
"time"
"github.com/open-policy-agent/opa/metrics"
"github.com/open-policy-agent/opa/storage"
"github.com/open-policy-agent/opa/topdown"
)
// Buffer defines an interface for recording decisions.
// DEPRECATED. Use Decision Logging instead.
type Buffer interface {
// Push adds the given Info into the buffer.
Push(*Info)
// Iter iterates over the buffer, from oldest present Info to newest. It should
// call fn on each Info.
Iter(fn func(*Info))
}
// Info contains information describing a policy decision.
type Info struct {
Txn storage.Transaction
Revision string // Deprecated: Use `Bundles` instead
Bundles map[string]BundleInfo
DecisionID string
RemoteAddr string
Query string
Path string
Timestamp time.Time
Input *interface{}
Results *interface{}
Error error
Metrics metrics.Metrics
Trace []*topdown.Event
}
// BundleInfo contains information describing a bundle
type BundleInfo struct {
Revision string
}