cli

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OnError = func(code int) {
	os.Exit(code)
}

OnError exit system with os.Exit with supplied code.

Functions

func DefaultFilter

func DefaultFilter() map[string]bool

DefaultFilter create default filter

func GetPath

func GetPath(candidates *model.Activities, runner *Runner, fullPath bool) string

GetPath returns hierarchical path to the latest Activity

func WildcardFilter

func WildcardFilter() map[string]bool

WildcardFilter

Types

type Asserted

type Asserted interface {
	Assertion() []*assertly.Validation
}

Asserted represent validation response

type EventTag

type EventTag struct {
	Description string
	Caller      string
	TagID       string
	Events      []msg.Event
	Validation  []*assertly.Validation
	PassedCount int
	FailedCount int
}

EventTag represents an event tag

func (*EventTag) AddEvent

func (e *EventTag) AddEvent(event msg.Event)

AddEvent add provided event

type Renderer

type Renderer struct {
	ErrorColor string
	// contains filtered or unexported fields
}

Renderer represents a renderer

func NewRenderer

func NewRenderer(writer io.Writer, minColumns int) *Renderer

NewRenderer creates a new renderer

func (*Renderer) ColorText

func (r *Renderer) ColorText(text string, textColors ...string) string

ColorText returns text with ANCI color

func (*Renderer) Columns

func (r *Renderer) Columns() int

Columns reutnrs terminal column count

func (*Renderer) Print

func (r *Renderer) Print(message string)

Print prints supplied message

func (*Renderer) PrintTable

func (r *Renderer) PrintTable(caption string, headers []string, data [][]string, maxSize int)

PrintTable prints supplied table data

func (*Renderer) Printf

func (r *Renderer) Printf(text string, args ...interface{})

Printf formats and print supplied text with arguments

func (*Renderer) Println

func (r *Renderer) Println(text string)

Println returns formatted text with arguments

func (*Renderer) Sprintf

func (r *Renderer) Sprintf(text string, args ...interface{}) string

Sprintf returns formatted text with arguments

type ReportSummaryEvent

type ReportSummaryEvent struct {
	ElapsedMs      int
	TotalTagPassed int
	TotalTagFailed int
	Error          bool
}

ReportSummaryEvent represents event summary

type Runner

type Runner struct {
	*Renderer
	*model.Activities

	MessageStyleColor  map[int]string
	InputColor         string
	OutputColor        string
	TagColor           string
	InverseTag         bool
	ServiceActionColor string
	PathColor          string
	SuccessColor       string
	ErrorColor         string
	// contains filtered or unexported fields
}

Testing represents command line runner

func New

func New() *Runner

New creates a new command line runner

func (*Runner) AddTag

func (r *Runner) AddTag(eventTag *EventTag)

AddTag adds reporting tag

func (*Runner) AsListener

func (r *Runner) AsListener() msg.Listener

func (*Runner) EventTag

func (r *Runner) EventTag() *EventTag

EventTag returns an event tag

func (*Runner) Run

func (r *Runner) Run(request *workflow.RunRequest) (err error)

Run run Caller for the supplied run request and runner options.

Jump to

Keyboard shortcuts

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