runner

package
v0.24.290 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseOperation

type BaseOperation struct {
	Frequency time.Duration
	Id        uuid.UUID
	Name      string
}

func NewBaseOperation

func NewBaseOperation(name string, freq time.Duration) *BaseOperation

func (*BaseOperation) GetFrequency

func (e *BaseOperation) GetFrequency() time.Duration

func (*BaseOperation) GetId

func (e *BaseOperation) GetId() uuid.UUID

func (*BaseOperation) GetName

func (e *BaseOperation) GetName() string

func (*BaseOperation) SetFrequency

func (e *BaseOperation) SetFrequency(f time.Duration) error

type ErrorHandler

type ErrorHandler func(error, Operation)

type LimitedRunner

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

func (*LimitedRunner) AddOperation

func (r *LimitedRunner) AddOperation(e Operation) error

func (*LimitedRunner) IsRunning

func (r *LimitedRunner) IsRunning() bool

func (*LimitedRunner) RemoveOperation

func (r *LimitedRunner) RemoveOperation(e Operation) error

func (*LimitedRunner) RemovePolicyById

func (r *LimitedRunner) RemovePolicyById(id uuid.UUID) (Operation, error)

func (*LimitedRunner) Start

func (r *LimitedRunner) Start(closeNotify <-chan struct{}) error

func (*LimitedRunner) Stop

func (r *LimitedRunner) Stop() error

type Operation

type Operation interface {
	GetName() string
	GetId() uuid.UUID
	Run() error
	GetFrequency() time.Duration
	SetFrequency(duration time.Duration) error
}

type Runner

type Runner interface {
	AddOperation(Operation) error
	RemoveOperation(Operation) error
	RemovePolicyById(uuid.UUID) (Operation, error)
	Start(closeNotify <-chan struct{}) error
	Stop() error
	IsRunning() bool
}

func NewRunner

func NewRunner(minF, maxF time.Duration, eh ErrorHandler) (Runner, error)

Jump to

Keyboard shortcuts

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