Documentation ¶
Index ¶
- Constants
- func RegisterEndpoint(method, path string, handler web.HandlerFunc)
- func RegisterJobMiddleware(mw job.MiddlewareFunc)
- func RegisterNodeMiddleware(mw node.MiddlewareFunc)
- func RegisterTaskMiddleware(mw task.MiddlewareFunc)
- func RegisterWebMiddleware(mw web.MiddlewareFunc)
- func Run() error
- func SetMode(mode Mode)
- func Start() error
- func SubmitJob(ctx context.Context, ij *input.Job, listeners ...web.JobListener) (*tork.Job, error)
- func Terminate() error
- type Config
- type Engine
- func (e *Engine) RegisterEndpoint(method, path string, handler web.HandlerFunc)
- func (e *Engine) RegisterJobMiddleware(mw job.MiddlewareFunc)
- func (e *Engine) RegisterNodeMiddleware(mw node.MiddlewareFunc)
- func (e *Engine) RegisterTaskMiddleware(mw task.MiddlewareFunc)
- func (e *Engine) RegisterWebMiddleware(mw web.MiddlewareFunc)
- func (e *Engine) Run() error
- func (e *Engine) SetMode(mode Mode)
- func (e *Engine) Start() error
- func (e *Engine) SubmitJob(ctx context.Context, ij *input.Job, listeners ...web.JobListener) (*tork.Job, error)
- func (e *Engine) Terminate() error
- type Middleware
- type Mode
- type OnStartedHandler
Constants ¶
View Source
const ( StateIdle = "IDLE" StateRunning = "RUNNING" StateTerminating = "TERMINATING" StateTerminated = "TERMINATED" )
Variables ¶
This section is empty.
Functions ¶
func RegisterEndpoint ¶ added in v0.1.7
func RegisterEndpoint(method, path string, handler web.HandlerFunc)
func RegisterJobMiddleware ¶ added in v0.1.7
func RegisterJobMiddleware(mw job.MiddlewareFunc)
func RegisterNodeMiddleware ¶ added in v0.1.7
func RegisterNodeMiddleware(mw node.MiddlewareFunc)
func RegisterTaskMiddleware ¶ added in v0.1.7
func RegisterTaskMiddleware(mw task.MiddlewareFunc)
func RegisterWebMiddleware ¶ added in v0.1.7
func RegisterWebMiddleware(mw web.MiddlewareFunc)
Types ¶
type Config ¶ added in v0.1.5
type Config struct { Mode Mode Middleware Middleware Endpoints map[string]web.HandlerFunc }
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) RegisterEndpoint ¶
func (e *Engine) RegisterEndpoint(method, path string, handler web.HandlerFunc)
func (*Engine) RegisterJobMiddleware ¶
func (e *Engine) RegisterJobMiddleware(mw job.MiddlewareFunc)
func (*Engine) RegisterNodeMiddleware ¶
func (e *Engine) RegisterNodeMiddleware(mw node.MiddlewareFunc)
func (*Engine) RegisterTaskMiddleware ¶
func (e *Engine) RegisterTaskMiddleware(mw task.MiddlewareFunc)
func (*Engine) RegisterWebMiddleware ¶ added in v0.1.7
func (e *Engine) RegisterWebMiddleware(mw web.MiddlewareFunc)
type Middleware ¶ added in v0.1.5
type Middleware struct { Web []web.MiddlewareFunc Task []task.MiddlewareFunc Job []job.MiddlewareFunc Node []node.MiddlewareFunc }
type OnStartedHandler ¶
type OnStartedHandler func() error
OnStartedHandler a bootstrap hook that is called after Tork has finished starting up. If a non-nil error is returned it will terminate the bootstrap process.
Click to show internal directories.
Click to hide internal directories.