fnmap

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name      string
	Namespace string
	Client    client.Client
	Output    output.Output
	Result    result.Result
}

type FuncMap

type FuncMap interface {
	Register(fnType ctrlcfgv1.FunctionType, initFn Initializer)
	Run(ctx context.Context, vertexContext *rtdag.VertexContext, i input.Input) (output.Output, error)
}

func New

func New(c *Config) FuncMap

type Function

type Function interface {
	// Init initializes the device
	Init(...FunctionOption)
	WithOutput(output output.Output)
	WithResult(result result.Result)
	WithNameAndNamespace(name, namespace string)
	WithClient(client client.Client)
	WithFnMap(fnMap FuncMap)
	Run(ctx context.Context, vertexContext *rtdag.VertexContext, i input.Input) (output.Output, error)
}

type FunctionOption

type FunctionOption func(Function)

func WithClient

func WithClient(client client.Client) FunctionOption

func WithFnMap

func WithFnMap(fnMap FuncMap) FunctionOption

func WithNameAndNamespace

func WithNameAndNamespace(name, namespace string) FunctionOption

func WithOutput

func WithOutput(output output.Output) FunctionOption

func WithResult

func WithResult(result result.Result) FunctionOption

type Initializer

type Initializer func() Function

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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