fn

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cue

type Cue struct {
	fnv1beta1.UnimplementedFunctionRunnerServiceServer
	// contains filtered or unexported fields
}

Cue runs cue scripts that adhere to a specific interface.

func New

func New(opts Options) (*Cue, error)

New creates a cue runner.

func (*Cue) Eval

func (f *Cue) Eval(in *fnv1beta1.RunFunctionRequest, script string, debug DebugOptions) (*fnv1beta1.State, error)

Eval evaluates the supplied script with an additional _request object using the supplied request and returns the response as a State message.

func (*Cue) RunFunction

func (f *Cue) RunFunction(_ context.Context, req *fnv1beta1.RunFunctionRequest) (outRes *fnv1beta1.RunFunctionResponse, finalErr error)

RunFunction runs the function. It expects a single script that is complete except for a `_request` variable that the function runner supplies.

type DebugOptions

type DebugOptions struct {
	Enabled bool // enable input/ output debugging
	Raw     bool // do not remove any "noise" attributes in the input object
	Script  bool // render the final script as a debug output
}

DebugOptions are per-eval debug options.

type Options

type Options struct {
	Logger logging.Logger
	Debug  bool
}

Options are options for the cue runner.

Jump to

Keyboard shortcuts

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