step

package
v0.0.0-...-f1bdcb5 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Function

type Function func() (*Result, error)

type Groups

type Groups struct {
	// contains filtered or unexported fields
}

func NewGroups

func NewGroups() *Groups

func (*Groups) Get

func (g *Groups) Get(name string) *Steps

func (*Groups) Names

func (g *Groups) Names() []string

type Result

type Result struct {
	Status  Status
	Message string
}

func NewResult

func NewResult(status Status, message string) *Result

func NewResultError

func NewResultError(message string) *Result

func NewResultSuccess

func NewResultSuccess(message string) *Result

func NewResultWarning

func NewResultWarning(message string) *Result

type Status

type Status string
const (
	Error   Status = "error"
	Warning Status = "warning"
	Success Status = "success"
)

func (Status) Validate

func (s Status) Validate() error

type Step

type Step struct {
	Name     string
	Func     Function
	Replacer *strings.Replacer
}

func NewStep

func NewStep(name string, fn Function, masked []string) *Step

func (*Step) Call

func (step *Step) Call() (res *Result)

type Steps

type Steps struct {
	// contains filtered or unexported fields
}

func NewSteps

func NewSteps() *Steps

func (*Steps) Add

func (s *Steps) Add(name string, test Function, masked []string) *Steps

func (*Steps) Get

func (s *Steps) Get(name string) *Step

func (*Steps) Names

func (s *Steps) Names() []string

Jump to

Keyboard shortcuts

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