fnmap

package
v0.0.0-...-f5227cc Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: Apache-2.0 Imports: 10 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
	RootVertexName string
	ControllerName string
	Client         client.Client
	Output         output.Output
	Result         result.Result
	FnClients      *clients.Clients
}

type FuncMap

type FuncMap interface {
	Register(fnType ctrlcfgv1alpha1.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)
	WithRootVertexName(name string)
	WithFnClients(*clients.Clients)
	WithControllerName(name string)
	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 WithControllerName

func WithControllerName(name string) FunctionOption

func WithFnClients

func WithFnClients(fnc *clients.Clients) 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

func WithRootVertexName

func WithRootVertexName(name string) 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