reports

package
v0.0.0-...-e59334c Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregateReport

type AggregateReport struct {
	Names   []string `json:"names"`
	Results []string `json:"results"`
	// contains filtered or unexported fields
}

AggregateReport represents an aggregate filter report

func NewAggregateReport

func NewAggregateReport() *AggregateReport

NewAggregateReport returns an instance of *AggregateReport

func (*AggregateReport) AddName

func (ar *AggregateReport) AddName(name string) *AggregateReport

AddName appends actionable list names to the report

func (*AggregateReport) AddReason

func (br *AggregateReport) AddReason(reason string, values ...interface{})

AddReason appends a reason for why an element of the actionable list remained or was excluded

func (*AggregateReport) AddResults

func (ar *AggregateReport) AddResults(results ...string) *AggregateReport

AddResults appends report results

func (*AggregateReport) Error

func (ar *AggregateReport) Error(err error) Reportable

Error adds an error message to the summary

func (*AggregateReport) Line

func (ar *AggregateReport) Line() (string, error)

Line returns a human readable string for a filter runner's activity

func (*AggregateReport) SetCriteria

func (br *AggregateReport) SetCriteria(criteria criterias.Criteriable)

SetCriteria sets the criteria used by the filter runner

func (*AggregateReport) SetType

func (br *AggregateReport) SetType(actionType string)

SetType sets the element type (index/snapshot)

func (*AggregateReport) ToJson

func (br *AggregateReport) ToJson() (*gabs.Container, error)

ToJson converts the report to JSON

type Report

type Report struct {
	Name   string `json:"name"`
	Result bool   `json:"result"`
	// contains filtered or unexported fields
}

Report represents a filter report

func NewReport

func NewReport() *Report

NewReport returns an instance of *Report

func (*Report) AddReason

func (br *Report) AddReason(reason string, values ...interface{})

AddReason appends a reason for why an element of the actionable list remained or was excluded

func (*Report) Error

func (r *Report) Error(err error) Reportable

Error adds an error message to the summary

func (*Report) Line

func (r *Report) Line() (string, error)

Line returns a human readable string or a filter runner activity

func (*Report) SetCriteria

func (br *Report) SetCriteria(criteria criterias.Criteriable)

SetCriteria sets the criteria used by the filter runner

func (*Report) SetName

func (r *Report) SetName(name string) *Report

SetName sets the name of the element being filtered

func (*Report) SetResult

func (r *Report) SetResult(result bool) *Report

SetResult sets the result of a given filter

func (*Report) SetType

func (br *Report) SetType(actionType string)

SetType sets the element type (index/snapshot)

func (*Report) ToJson

func (br *Report) ToJson() (*gabs.Container, error)

ToJson converts the report to JSON

type Reportable

type Reportable interface {
	// Line returns a human readable string or a filter runner activity
	Line() (string, error)

	// SetCriteria sets the criteria used by the filter runner
	SetCriteria(criteria criterias.Criteriable)

	// ToJson converts the report to JSON
	ToJson() (*gabs.Container, error)

	// AddReason appends a reason for why an element of
	// the actionable list remained or was excluded
	AddReason(reason string, values ...interface{})

	// Error adds an error message to the summary
	Error(err error) Reportable
}

Reportable is a contract implemented by structs that report on the activity of a filter runner

Jump to

Keyboard shortcuts

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