gestalt

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2019 License: MIT Imports: 18 Imported by: 2

README

Gestalt

Build Status codecov

Gestalt is an integration test framework built for testing CLI-based workflows.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dump

func Dump(c Component)

func NewComponent

func NewComponent(name string, action Action) *component

func NewError

func NewError(path string, wrapped error) *evalError

func NewEvaluator

func NewEvaluator(visitors ...Visitor) *evaluator

func NewEvaluatorWithLogger

func NewEvaluatorWithLogger(logger Logger, visitors ...Visitor) *evaluator

func NewValidator

func NewValidator() *validator

func NoopComponent

func NoopComponent(name string) *component

func Run

func Run(c Component)

func RunWith

func RunWith(c Component, args []string)

func Traverse

func Traverse(node Component, visitors ...Visitor)

func TraversePaths

func TraversePaths(node Component, fn func(string))

Types

type Action

type Action func(Evaluator) error

type Component

type Component interface {
	Name() string
	IsPassThrough() bool
	Eval(Evaluator) error
	WithMeta(vars.Meta) Component
	Meta() vars.Meta
}

type CompositeComponent

type CompositeComponent interface {
	Component
	Children() []Component
}

type Error

type Error interface {
	ErrorWithDetail
	Path() string
}

type ErrorWithDetail

type ErrorWithDetail interface {
	Error() string
	Detail() string
}

type Evaluator

type Evaluator interface {
	Log() logrus.FieldLogger
	Logger() Logger
	Path() string

	Evaluate(Component) error
	Fork(Component) error

	Emit(string, string)
	Vars() vars.Vars

	Message(string, ...interface{})

	Context() context.Context

	Stop()
	Wait()

	HasError() bool
	ClearError()
	Errors() []error

	Root() Component
}

type Logger

type Logger interface {
	Log() logrus.FieldLogger
	CloneFor(string) Logger
	Clone() Logger

	Start()
	Message(string, ...interface{})
	Dump(string)
	Stop(error)
}

type Runner

type Runner interface {
	WithArgs([]string) Runner
	WithComponent(Component) Runner
	WithTerminate(func(status int)) Runner
	Run()
}

func NewRunner

func NewRunner() Runner

type Traverser

type Traverser interface {
	Path() string
}

type Unresolved

type Unresolved struct {
	Path string
	Name string
}

func Validate

func Validate(c Component) []Unresolved

func ValidateWith

func ValidateWith(c Component, vars vars.Vars) []Unresolved

type Visitor

type Visitor interface {
	Push(Traverser, Component)
	Pop(Traverser, Component)
}

Directories

Path Synopsis
js

Jump to

Keyboard shortcuts

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