runner

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: MIT Imports: 9 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 BaseRunner

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

func NewBase

func NewBase(name string) *BaseRunner

func (*BaseRunner) AppendError

func (br *BaseRunner) AppendError(err ...error)

func (*BaseRunner) AppendRunner

func (br *BaseRunner) AppendRunner(r Runner) bool

func (*BaseRunner) BoolValue

func (br *BaseRunner) BoolValue(k string) bool

func (*BaseRunner) Children

func (br *BaseRunner) Children() []Runner

func (*BaseRunner) ChildrenError

func (br *BaseRunner) ChildrenError() error

func (*BaseRunner) Collect

func (br *BaseRunner) Collect() map[string]string

func (*BaseRunner) CollectF

func (br *BaseRunner) CollectF(f func(map[string]string))

func (*BaseRunner) Ctx

func (br *BaseRunner) Ctx() context.Context

func (*BaseRunner) Debug

func (br *BaseRunner) Debug(msg string, kvs ...any)

func (*BaseRunner) DelKey

func (br *BaseRunner) DelKey(k string)

func (*BaseRunner) Done

func (br *BaseRunner) Done() <-chan struct{}

func (*BaseRunner) Err

func (br *BaseRunner) Err(msg string, err error, kvs ...any)

func (*BaseRunner) Error

func (br *BaseRunner) Error() error

func (*BaseRunner) FloatValue

func (br *BaseRunner) FloatValue(k string) float64

func (*BaseRunner) FloatValueOr

func (br *BaseRunner) FloatValueOr(k string, d float64) float64

func (*BaseRunner) GetChild

func (br *BaseRunner) GetChild(name string) Runner

func (*BaseRunner) HasKey

func (br *BaseRunner) HasKey(k string) bool

func (*BaseRunner) Info

func (br *BaseRunner) Info(msg string, kvs ...any)

func (*BaseRunner) Init

func (br *BaseRunner) Init() error

func (*BaseRunner) Int64Value

func (br *BaseRunner) Int64Value(k string) int64

func (*BaseRunner) Int64ValueOr

func (br *BaseRunner) Int64ValueOr(k string, d int64) int64

func (*BaseRunner) IntValue

func (br *BaseRunner) IntValue(k string) int

func (*BaseRunner) IntValueOr

func (br *BaseRunner) IntValueOr(k string, d int) int

func (*BaseRunner) Logger

func (br *BaseRunner) Logger() *zap.Logger

func (*BaseRunner) Name

func (br *BaseRunner) Name() string

func (*BaseRunner) OnChildDone

func (br *BaseRunner) OnChildDone(_ Runner) error

func (*BaseRunner) Parent

func (br *BaseRunner) Parent() Runner

func (*BaseRunner) SelfError

func (br *BaseRunner) SelfError() error

func (*BaseRunner) SetCtx

func (br *BaseRunner) SetCtx(ctx context.Context)

func (*BaseRunner) SetName

func (br *BaseRunner) SetName(n string)

func (*BaseRunner) SetParent

func (br *BaseRunner) SetParent(r Runner)

func (*BaseRunner) Start

func (br *BaseRunner) Start() error

func (*BaseRunner) Started

func (br *BaseRunner) Started() <-chan struct{}

func (*BaseRunner) Stop

func (br *BaseRunner) Stop() error

func (*BaseRunner) StopDone

func (br *BaseRunner) StopDone() <-chan struct{}

func (*BaseRunner) Stopping

func (br *BaseRunner) Stopping() <-chan struct{}

func (*BaseRunner) Store

func (br *BaseRunner) Store(k string, v any)

func (*BaseRunner) StoreValues

func (br *BaseRunner) StoreValues(m map[string]string)

func (*BaseRunner) StringValue

func (br *BaseRunner) StringValue(k string) string

func (*BaseRunner) StringValueOr

func (br *BaseRunner) StringValueOr(k string, d string) string

func (*BaseRunner) ValueTo

func (br *BaseRunner) ValueTo(k string, to any) error

func (*BaseRunner) WaitChildrenDone

func (br *BaseRunner) WaitChildrenDone()

func (*BaseRunner) Warn

func (br *BaseRunner) Warn(msg string, kvs ...any)

func (*BaseRunner) WithLogger

func (br *BaseRunner) WithLogger(l *zap.Logger, kvs ...any)

func (*BaseRunner) WithLoggerNoName

func (br *BaseRunner) WithLoggerNoName(l *zap.Logger, kvs ...any)

type Runner

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

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

	Logger() *zap.Logger
	WithLogger(l *zap.Logger, kvs ...any)
	WithLoggerNoName(l *zap.Logger, kvs ...any)

	Debug(msg string, kvs ...any)
	Info(msg string, kvs ...any)
	Warn(msg string, kvs ...any)
	Err(msg string, err error, kvs ...any)

	Store(k string, v any)
	DelKey(k string)
	HasKey(k string) bool
	BoolValue(k string) bool
	StringValue(k string) string
	StringValueOr(k string, d string) string
	IntValue(k string) int
	IntValueOr(k string, d int) int
	Int64Value(k string) int64
	Int64ValueOr(k string, d int64) int64
	FloatValue(k string) float64
	FloatValueOr(k string, d float64) float64
	ValueTo(k string, to any) error
	Collect() map[string]string
	CollectF(func(map[string]string))
	StoreValues(map[string]string)

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

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

	AppendError(err ...error)
	Error() error
	SelfError() error
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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