runner

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: MIT Imports: 10 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Inherit added in v0.0.3

func Inherit(to Runner, from Runner)

func Init

func Init(r Runner) error

func Start

func Start(r Runner)

func StartBG

func StartBG(r Runner)

func Stop

func Stop(r Runner)

Types

type Runner

type Runner interface {
	Init() error
	Start() error
	Stop() error

	Name() string
	SetName(string)
	Ctx() context.Context
	SetCtx(context.Context)

	Started() <-chan struct{}
	Stopping() <-chan struct{}
	StopDone() <-chan struct{}
	Done() <-chan struct{}

	GetChild(string) Runner
	Children() []Runner
	AppendRunner(Runner) bool
	WaitChildrenDone()
	SetParent(Runner)
	Parent() Runner
	OnChildDone(Runner) error

	AppendError(err ...error)
	Err() error
	SelfErr() error
	ChildrenErr() error

	WithLoggerFrom(r Runner, kvs ...any)
	WithLoggerFields(kvs ...any)
	Debug(msg string, kvs ...any)
	Info(msg string, kvs ...any)
	Warn(msg string, kvs ...any)
	Error(msg string, err error, kvs ...any)
	// contains filtered or unexported methods
}

func NewBase

func NewBase(name string) Runner

Jump to

Keyboard shortcuts

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