flow

package
v0.0.15 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Any

func Any(msg string, steps []*ProgressBarStep, wcc ...decor.WC) decor.Decorator

func OnComplete

func OnComplete(msg string, steps []*ProgressBarStep, wcc ...decor.WC) decor.Decorator

Types

type Flow

type Flow interface {
	Run(ctx context.Context, data interface{}, dryRun bool) (Result, error)
}

func ProgressBarSequence

func ProgressBarSequence(msg string, steps ...*ProgressBarStep) Flow

func Sequence

func Sequence(steps ...StepFunc) Flow

type ProgressBarOption

type ProgressBarOption func(step *ProgressBarStep)

func WithDisplay

func WithDisplay(display string) ProgressBarOption

type ProgressBarStep

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

func StepWithProgressBar

func StepWithProgressBar(step StepFunc, opts ...ProgressBarOption) *ProgressBarStep

func (ProgressBarStep) Bar

func (p ProgressBarStep) Bar() *mpb.Bar

func (ProgressBarStep) String

func (p ProgressBarStep) String() string

type Result

type Result interface{}

func RunWith

func RunWith(step Flow, ctx context.Context, data interface{}, dryRun bool) (Result, error)

type StepFunc

type StepFunc func(ctx context.Context, data interface{}, dryRun bool) (Result, error)

func (StepFunc) Run

func (fn StepFunc) Run(ctx context.Context, data interface{}, dryRun bool) (Result, error)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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