taskrepo

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TaskFunc

type TaskFunc func(interface{}) (interface{}, error)

TaskFunc is the type of the task callback.

type TaskRepository

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

TaskRepository is the in memory storage of tasks.

func NewTaskRepository

func NewTaskRepository() *TaskRepository

NewTaskRepository creates and returns a new TaskRepository instance.

func (*TaskRepository) GetTaskFunc

func (repo *TaskRepository) GetTaskFunc(name string) (TaskFunc, error)

GetTaskFunc returns the TaskFunc for a specified name if that exists in the repository.

func (*TaskRepository) GetTaskNames

func (repo *TaskRepository) GetTaskNames() []string

GetTaskNames returns all the names of the tasks currently in the repository.

func (*TaskRepository) Register

func (repo *TaskRepository) Register(name string, taskFunc TaskFunc)

Register registers a new task in the repository.

Jump to

Keyboard shortcuts

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