engine

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine[T, R any] struct {
	// contains filtered or unexported fields
}

Engine is a generic engine that can be used to run a chain of decorators and a handler.

func New

func New[T, R any](ctx context.Context, evt T, handler engine.Handler[T, R]) *Engine[T, R]

New creates a new engine with the given context, event and handler.

func (*Engine[T, R]) Run

func (e *Engine[T, R]) Run() (R, error)

Run executes the engine and returns the result of the handler.

func (*Engine[T, R]) Use

func (e *Engine[T, R]) Use(decorators ...engine.Decorator[T, R]) *Engine[T, R]

Use adds a list of decorators to the engine.

Jump to

Keyboard shortcuts

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