engine

package
v0.1.117 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: MIT Imports: 36 Imported by: 2

Documentation

Index

Constants

View Source
const (
	StateIdle        = "IDLE"
	StateRunning     = "RUNNING"
	StateTerminating = "TERMINATING"
	StateTerminated  = "TERMINATED"
)

Variables

This section is empty.

Functions

func Broker added in v0.1.114

func Broker() broker.Broker

func Datastore added in v0.1.114

func Datastore() datastore.Datastore

func RegisterBrokerProvider added in v0.1.16

func RegisterBrokerProvider(name string, provider broker.Provider)

func RegisterDatastoreProvider added in v0.1.16

func RegisterDatastoreProvider(name string, provider datastore.Provider)

func RegisterEndpoint added in v0.1.8

func RegisterEndpoint(method, path string, handler web.HandlerFunc)

func RegisterJobMiddleware added in v0.1.8

func RegisterJobMiddleware(mw job.MiddlewareFunc)

func RegisterMounter added in v0.1.16

func RegisterMounter(runtime, name string, mounter runtime.Mounter)

func RegisterNodeMiddleware added in v0.1.8

func RegisterNodeMiddleware(mw node.MiddlewareFunc)

func RegisterRuntime added in v0.1.19

func RegisterRuntime(rt runtime.Runtime)

func RegisterTaskMiddleware added in v0.1.8

func RegisterTaskMiddleware(mw task.MiddlewareFunc)

func RegisterWebMiddleware added in v0.1.8

func RegisterWebMiddleware(mw web.MiddlewareFunc)

func Run added in v0.1.8

func Run() error

func SetMode added in v0.1.8

func SetMode(mode Mode)

func Start added in v0.1.8

func Start() error

func SubmitJob added in v0.1.8

func SubmitJob(ctx context.Context, ij *input.Job, listeners ...JobListener) (*tork.Job, error)

func Terminate added in v0.1.8

func Terminate() error

Types

type Config added in v0.1.8

type Config struct {
	Mode       Mode
	Middleware Middleware
	Endpoints  map[string]web.HandlerFunc
}

type Engine

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

func New

func New(cfg Config) *Engine

func (*Engine) Broker added in v0.1.113

func (e *Engine) Broker() broker.Broker

Broker returns the broker used by the engine. It is only available after the engine has been started.

func (*Engine) Datastore added in v0.1.113

func (e *Engine) Datastore() datastore.Datastore

Datastore returns the datastore used by the engine. It is only available after the engine has been started.

func (*Engine) RegisterBrokerProvider added in v0.1.16

func (e *Engine) RegisterBrokerProvider(name string, provider broker.Provider)

func (*Engine) RegisterDatastoreProvider added in v0.1.16

func (e *Engine) RegisterDatastoreProvider(name string, provider datastore.Provider)

func (*Engine) RegisterEndpoint

func (e *Engine) RegisterEndpoint(method, path string, handler web.HandlerFunc)

func (*Engine) RegisterJobMiddleware added in v0.1.3

func (e *Engine) RegisterJobMiddleware(mw job.MiddlewareFunc)

func (*Engine) RegisterMounter added in v0.1.16

func (e *Engine) RegisterMounter(rt string, name string, mounter runtime.Mounter)

func (*Engine) RegisterNodeMiddleware added in v0.1.3

func (e *Engine) RegisterNodeMiddleware(mw node.MiddlewareFunc)

func (*Engine) RegisterRuntime added in v0.1.19

func (e *Engine) RegisterRuntime(rt runtime.Runtime)

func (*Engine) RegisterTaskMiddleware added in v0.1.3

func (e *Engine) RegisterTaskMiddleware(mw task.MiddlewareFunc)

func (*Engine) RegisterWebMiddleware added in v0.1.8

func (e *Engine) RegisterWebMiddleware(mw web.MiddlewareFunc)

func (*Engine) Run added in v0.1.8

func (e *Engine) Run() error

func (*Engine) SetMode added in v0.1.8

func (e *Engine) SetMode(mode Mode)

func (*Engine) Start

func (e *Engine) Start() error

func (*Engine) State added in v0.1.13

func (e *Engine) State() string

func (*Engine) SubmitJob added in v0.1.8

func (e *Engine) SubmitJob(ctx context.Context, ij *input.Job, listeners ...JobListener) (*tork.Job, error)

func (*Engine) Terminate

func (e *Engine) Terminate() error

type JobListener added in v0.1.67

type JobListener func(j *tork.Job)

type Middleware added in v0.1.8

type Middleware struct {
	Web  []web.MiddlewareFunc
	Task []task.MiddlewareFunc
	Job  []job.MiddlewareFunc
	Node []node.MiddlewareFunc
}

type Mode

type Mode string
const (
	ModeCoordinator Mode = "coordinator"
	ModeWorker      Mode = "worker"
	ModeStandalone  Mode = "standalone"
)

Jump to

Keyboard shortcuts

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