flow: github.com/gogap/flow Index | Files

package flow

import "github.com/gogap/flow"

Index

Package Files

context.go context_local.go flow.go handlers.go runner.go runner_pipe.go step.go task.go

func ContextProviders Uses

func ContextProviders() []string

func Handlers Uses

func Handlers() []string

func RegisterContextProvider Uses

func RegisterContextProvider(name string, newContextProviderFunc NewContextProviderFunc)

func RegisterHandler Uses

func RegisterHandler(name string, newHandlerFunc NewHandlerFunc)

func RegisterRunner Uses

func RegisterRunner(name string, newRunnerFunc NewRunnerFunc)

func Runners Uses

func Runners() []string

type Context Uses

type Context interface {
    ID() string

    Get(key string) (value interface{}, exist bool)
    Set(key string, value interface{}) Context
    Delete(key string) Context
    Flush()

    Keys() []string

    GetAll() map[string]interface{}
}

type ContextProvider Uses

type ContextProvider interface {
    NewContext(conf config.Configuration) Context
}

func NewContextProvider Uses

func NewContextProvider(name string, conf config.Configuration) (contextProvider ContextProvider, err error)

func NewLocalContextProvider Uses

func NewLocalContextProvider(conf config.Configuration) (provider ContextProvider, err error)

type ErrorHandler Uses

type ErrorHandler interface {
    Handle(err error, step *Step, ctx Context) bool
}

type Flow Uses

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

func NewFlow Uses

func NewFlow(name string, opts ...FlowOption) (f *Flow, err error)

func (*Flow) Name Uses

func (p *Flow) Name() string

func (*Flow) NewTask Uses

func (p *Flow) NewTask() *Task

func (*Flow) Setup Uses

func (p *Flow) Setup(steps []Step) *Flow

type FlowOption Uses

type FlowOption func(*Flow) error

func ConfigFile Uses

func ConfigFile(filename string) FlowOption

func ConfigString Uses

func ConfigString(str string) FlowOption

type Handler Uses

type Handler interface {
    Handle(step Step, ctx Context) error
}

func NewHandler Uses

func NewHandler(name string, conf config.Configuration) (handler Handler, err error)

type LocalContext Uses

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

func (*LocalContext) Delete Uses

func (p *LocalContext) Delete(key string) Context

func (*LocalContext) Flush Uses

func (p *LocalContext) Flush()

func (*LocalContext) Get Uses

func (p *LocalContext) Get(key string) (value interface{}, exist bool)

func (LocalContext) GetAll Uses

func (p LocalContext) GetAll() map[string]interface{}

func (*LocalContext) ID Uses

func (p *LocalContext) ID() string

func (LocalContext) Keys Uses

func (p LocalContext) Keys() []string

func (*LocalContext) Set Uses

func (p *LocalContext) Set(key string, value interface{}) Context

type LocalContextProvider Uses

type LocalContextProvider struct {
}

func (*LocalContextProvider) NewContext Uses

func (p *LocalContextProvider) NewContext(conf config.Configuration) Context

type NewContextProviderFunc Uses

type NewContextProviderFunc func(conf config.Configuration) (contextProvider ContextProvider, err error)

type NewHandlerFunc Uses

type NewHandlerFunc func(conf config.Configuration) (handler Handler, err error)

type NewRunnerFunc Uses

type NewRunnerFunc func(conf config.Configuration) (runner TaskRunner, err error)

type PipeTaskRunner Uses

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

func (*PipeTaskRunner) Name Uses

func (p *PipeTaskRunner) Name() string

func (*PipeTaskRunner) Run Uses

func (p *PipeTaskRunner) Run(task *Task)

func (*PipeTaskRunner) SetErrorHandler Uses

func (p *PipeTaskRunner) SetErrorHandler(handler ErrorHandler)

type Step Uses

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

func NewStep Uses

func NewStep(flowName, stepName, handlerName string, conf config.Configuration) Step

func (*Step) Flow Uses

func (p *Step) Flow() string

func (*Step) Handler Uses

func (p *Step) Handler() string

func (*Step) Name Uses

func (p *Step) Name() string

func (*Step) String Uses

func (p *Step) String() string

func (*Step) TaskID Uses

func (p *Step) TaskID() string

type Task Uses

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

func NewTask Uses

func NewTask(flo *Flow, ctx Context) *Task

func (*Task) Context Uses

func (p *Task) Context() Context

func (*Task) Errors Uses

func (p *Task) Errors() []error

func (*Task) Flow Uses

func (p *Task) Flow() string

func (*Task) ID Uses

func (p *Task) ID() string

func (*Task) LatestError Uses

func (p *Task) LatestError() error

func (*Task) Run Uses

func (p *Task) Run() (err error)

func (*Task) Status Uses

func (p *Task) Status() TaskStatus

func (*Task) String Uses

func (p *Task) String() string

type TaskRunner Uses

type TaskRunner interface {
    Run(task *Task)
    SetErrorHandler(handler ErrorHandler)
}

func NewPipeTaskRunner Uses

func NewPipeTaskRunner(conf config.Configuration) (runner TaskRunner, err error)

func NewRunner Uses

func NewRunner(name string, conf config.Configuration) (runner TaskRunner, err error)

type TaskStatus Uses

type TaskStatus int
var (
    TaskStatusReady   TaskStatus = 1
    TaskStatusPending TaskStatus = 2
    TaskStatusRunning TaskStatus = 3
    TaskStatusDone    TaskStatus = 4
)

Package flow imports 6 packages (graph). Updated 2017-09-10. Refresh now. Tools for package owners.