package presentation
import "github.com/open-policy-agent/opa/internal/presentation"
Package presentation prints results of an expression evaluation in json and tabular formats.
Index ¶
- Variables
- func Bindings(w io.Writer, r Output) error
- func JSON(w io.Writer, x interface{}) error
- func Pretty(w io.Writer, r Output) error
- func Values(w io.Writer, r Output) error
- type DepAnalysisOutput
- func (o DepAnalysisOutput) JSON(w io.Writer) error
- func (o DepAnalysisOutput) Pretty(w io.Writer) error
- type Output
Variables ¶
var DefaultProfileSortOrder = []string{"total_time_ns", "num_eval", "num_redo", "file", "line"}
DefaultProfileSortOrder is the default ordering unless something is specified in the CLI
Functions ¶
func Bindings ¶
Bindings prints the bindings from r to w.
func JSON ¶
JSON writes x to w with indentation.
func Pretty ¶
Pretty prints all of r to w in a human-readable format.
func Values ¶
Values prints the values from r to w.
Types ¶
type DepAnalysisOutput ¶
type DepAnalysisOutput struct { Base []ast.Ref `json:"base,omitempty"` Virtual []ast.Ref `json:"virtual,omitempty"` }
DepAnalysisOutput contains the result of dependency analysis to be presented.
func (DepAnalysisOutput) JSON ¶
func (o DepAnalysisOutput) JSON(w io.Writer) error
JSON outputs o to w as JSON.
func (DepAnalysisOutput) Pretty ¶
func (o DepAnalysisOutput) Pretty(w io.Writer) error
Pretty outputs o to w in a human-readable format.
type Output ¶
type Output struct { Error error `json:"error,omitempty"` Result rego.ResultSet `json:"result,omitempty"` Partial *rego.PartialQueries `json:"partial,omitempty"` Metrics metrics.Metrics `json:"metrics,omitempty"` Explanation []*topdown.Event `json:"explanation,omitempty"` Profile []profiler.ExprStats `json:"profile,omitempty"` Coverage *cover.Report `json:"coverage,omitempty"` // contains filtered or unexported fields }
Output contains the result of evaluation to be presented.
func (Output) WithLimit ¶
WithLimit sets the output limit to set on stringified values.
Source Files ¶
- Version
- v0.12.0
- Published
- Jun 11, 2019
- Platform
- js/wasm
- Imports
- 16 packages
- Last checked
- 28 minutes ago –
Tools for package owners.