goro

package module
v0.0.0-...-42a74c5 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2016 License: MIT Imports: 4 Imported by: 5

README

goro

Go lang task runner

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arg

type Arg interface{}

type Context

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

func (*Context) GetArgs

func (ctx *Context) GetArgs() []Arg

func (*Context) GetLog

func (ctx *Context) GetLog() *log.Logger

func (*Context) GetReader

func (ctx *Context) GetReader() (*PipeSync, error)

func (*Context) GetWriter

func (ctx *Context) GetWriter() (*PipeSync, error)

func (*Context) SetReader

func (ctx *Context) SetReader(r *PipeSync)

func (*Context) SetWriter

func (ctx *Context) SetWriter(w *PipeSync)

type Goro

type Goro interface {
	AddTask(string, WorkerFn)
	LoadTask(string, ...Arg) *Task
}

type PipeSync

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

func NewPipeSync

func NewPipeSync() *PipeSync

func (*PipeSync) Read

func (ps *PipeSync) Read(b []byte) (int, error)

func (*PipeSync) Write

func (ps *PipeSync) Write(b []byte) (int, error)

type Task

type Task struct {
	Name string
	// contains filtered or unexported fields
}

func NewTask

func NewTask(workerFn WorkerFn, logger *log.Logger, args ...Arg) *Task

func (*Task) HasInput

func (t *Task) HasInput() bool

func (*Task) Pipe

func (t *Task) Pipe(task *Task) *Task

func (*Task) RunPipeSync

func (t *Task) RunPipeSync() error

RunPipeSync runs each task in the pipeline downstream calling task.RunSync recursively

func (*Task) RunSync

func (t *Task) RunSync() error

RunSync runs worker one time

func (*Task) SetInput

func (t *Task) SetInput(in *PipeSync) error

type TaskManager

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

func NewTaskManager

func NewTaskManager(logger *log.Logger) *TaskManager

func (*TaskManager) AddTask

func (manager *TaskManager) AddTask(name string, wf WorkerFn)

func (*TaskManager) LoadTask

func (manager *TaskManager) LoadTask(name string, args ...Arg) *Task

func (*TaskManager) SetLogger

func (manager *TaskManager) SetLogger(logger *log.Logger)

type Worker

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

func NewWorker

func NewWorker(runner WorkerFn) *Worker

func (*Worker) GetContext

func (w *Worker) GetContext() *Context

func (*Worker) Run

func (w *Worker) Run() error

func (*Worker) SetContext

func (w *Worker) SetContext(ctx *Context)

type WorkerFn

type WorkerFn func(*Context) error

Directories

Path Synopsis
containers
utils

Jump to

Keyboard shortcuts

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