engine

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: MIT Imports: 13 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

func New

func New(mode Mode) *Engine

func (*Engine) OnStarted

func (e *Engine) OnStarted(h OnStartedHandler)

func (*Engine) RegisterEndpoint

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

func (*Engine) RegisterMiddleware

func (e *Engine) RegisterMiddleware(mw middleware.MiddlewareFunc)

func (*Engine) Start

func (e *Engine) Start() error

func (*Engine) Terminate

func (e *Engine) Terminate()

type Mode

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

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.

Jump to

Keyboard shortcuts

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