joule

package
v0.0.0-...-aa4546b Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLIRunner

type CLIRunner[OT any] struct {
	Ctx *context.Context

	Opts OT
	Args []string
	// contains filtered or unexported fields
}

func NewCLIRunner

func NewCLIRunner[OT any](
	opts OT, args []string,
	stdin io.Reader, stdout io.Writer, stderr io.Writer,
	startup func(cr *CLIRunner[OT]) error,
	shutdown func(cr *CLIRunner[OT]) error,
) *CLIRunner[OT]

func (*CLIRunner[OT]) AddUow

func (cr *CLIRunner[OT]) AddUow(
	id string,
	work func(context.Context, UnitOfWork, interface{}) (interface{}, error),
) UnitOfWork

func (*CLIRunner[OT]) CancelFunc

func (cr *CLIRunner[OT]) CancelFunc() context.CancelFunc

func (*CLIRunner[OT]) GetUow

func (cr *CLIRunner[OT]) GetUow(id string) UnitOfWork

func (*CLIRunner[OT]) Run

func (cr *CLIRunner[OT]) Run() error

func (*CLIRunner[OT]) SetWorkDelay

func (cr *CLIRunner[OT]) SetWorkDelay(workDelay time.Duration)

type UnitOfWork

type UnitOfWork interface {
	GetId() string
	SetInput(interface{})
	GetOutput() interface{}
	GetError() error
	UiSecret(string) string
	UiOut([]byte)
	UiErr([]byte)
	UiStrOut(string)
	UiStrErr(string)
	UiOutWriter() io.Writer
	UiErrWriter() io.Writer
}

Jump to

Keyboard shortcuts

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