cbcli

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TaskNotFound = errors.New("task not found")

Functions

This section is empty.

Types

type Config added in v0.0.2

type Config interface {
	/**
	first return type is whether the config is enabled
	second return type is an error when the config path is not defined
	the path passed in will be in the format: cbcli.group.name
	where group and name are replaced with the task's returned values
	*/
	GetRequiredBool(path string) (bool, error)
}

type ErrorAfterDurationTask added in v0.1.0

type ErrorAfterDurationTask interface {
	GetErrorAfterDuration() time.Duration
}

type ErrorHandler

type ErrorHandler interface {
	Error(e error)
	Recover()
}

type GoroutineConfigurableTask added in v0.2.0

type GoroutineConfigurableTask interface {
	ExecuteInGoroutine() bool
}

type Logger

type Logger interface {
	InfoF(category string, message string, args ...interface{})
	Write(message []byte) (n int, e error)
}

type ScheduledTask added in v0.2.0

type ScheduledTask interface {
	GetSchedule() string
}

type Task

type Task interface {
	GetGroup() string
	GetName() string
	Run() error
}

type TaskContainer

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

func New

func New() *TaskContainer

func (*TaskContainer) AddTask

func (t *TaskContainer) AddTask(task Task)

func (*TaskContainer) DispatchTasks

func (t *TaskContainer) DispatchTasks()

func (*TaskContainer) Execute

func (t *TaskContainer) Execute() error

func (*TaskContainer) RunTask

func (t *TaskContainer) RunTask(group, name string) error

func (*TaskContainer) SetConfig added in v0.0.2

func (t *TaskContainer) SetConfig(config Config)

func (*TaskContainer) SetDispatchEnvironment added in v0.0.3

func (t *TaskContainer) SetDispatchEnvironment(envs []string)

func (*TaskContainer) SetErrorHandler

func (t *TaskContainer) SetErrorHandler(handler ErrorHandler)

func (*TaskContainer) SetLogger

func (t *TaskContainer) SetLogger(logger Logger)

Jump to

Keyboard shortcuts

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