cbcli

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2020 License: MIT Imports: 9 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 ErrorHandler

type ErrorHandler interface {
	Error(e error)
}

type Logger

type Logger interface {
	InfoF(category string, message string, args ...interface{})
}

type Task

type Task interface {
	GetSchedule() string
	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) 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