presentation

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package presentation prints results of an expression evaluation in json and tabular formats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bindings

func Bindings(w io.Writer, r Output) error

Bindings prints the bindings from r to w.

func JSON

func JSON(w io.Writer, x interface{}) error

JSON writes x to w with indentation.

func Pretty

func Pretty(w io.Writer, r Output) error

Pretty prints all of r to w in a human-readable format.

func Values

func Values(w io.Writer, r Output) error

Values prints the values from r to w.

Types

type Output

type Output struct {
	Error       error                `json:"error,omitempty"`
	Result      rego.ResultSet       `json:"result,omitempty"`
	Metrics     metrics.Metrics      `json:"metrics,omitempty"`
	Explanation []*topdown.Event     `json:"explanation,omitempty"`
	Profile     []profiler.ExprStats `json:"profile,omitempty"`
	// contains filtered or unexported fields
}

Output contains the result of evaluation to be presented.

func (Output) WithLimit

func (e Output) WithLimit(n int) Output

WithLimit sets the output limit to set on stringified values.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL