flow

package
v0.0.0-...-93cf5cb Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Async

func Async(task *AsyncTask, runnable Runnable, cleanup ...Runnable) (Runnable, Runnable)

func WaitTimeout

func WaitTimeout(wg *sync.WaitGroup, timeout time.Duration) bool

WaitTimeout waits for `wg` for the specified `timeout`. Returns true if waiting timed out.

Types

type AsyncTask

type AsyncTask struct {
	Context
	// contains filtered or unexported fields
}

func (*AsyncTask) Cancel

func (t *AsyncTask) Cancel()

func (*AsyncTask) CancelAndWait

func (t *AsyncTask) CancelAndWait()

func (*AsyncTask) Complete

func (t *AsyncTask) Complete()

func (*AsyncTask) Wait

func (t *AsyncTask) Wait()

type Context

type Context struct {
	context.Context
	*testing.T
	*Flow
	// contains filtered or unexported fields
}

func (Context) Deadline

func (c Context) Deadline() (deadline time.Time, ok bool)

func (Context) Done

func (c Context) Done() <-chan struct{}

func (Context) Err

func (c Context) Err() error

func (Context) Get

func (c Context) Get(args ...interface{}) bool

func (Context) MustGet

func (c Context) MustGet(args ...interface{})

func (Context) Name

func (c Context) Name() string

func (Context) Set

func (c Context) Set(varName string, value interface{})

func (Context) Value

func (c Context) Value(key interface{}) interface{}

func (Context) WithCancel

func (c Context) WithCancel() (Context, context.CancelFunc)

func (Context) WithTimeout

func (c Context) WithTimeout(timeout time.Duration) (Context, context.CancelFunc)

type Flow

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

func New

func New(t *testing.T, name string) *Flow

func (*Flow) Name

func (f *Flow) Name() string

func (*Flow) Run

func (f *Flow) Run()

func (*Flow) Step

func (f *Flow) Step(name string, runnable Runnable, cleanup ...Runnable) *Flow

func (*Flow) StepAsync

func (f *Flow) StepAsync(name string, task *AsyncTask, runnable Runnable, cleanup ...Runnable) *Flow

type Resetable

type Resetable interface {
	Reset()
}

type Runnable

type Runnable func(ctx Context) error

func Do

func Do(fn func() error) Runnable

func MustDo

func MustDo(fn func()) Runnable

func Reset

func Reset(reset ...Resetable) Runnable

func Sleep

func Sleep(t time.Duration) Runnable

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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