fn

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 17 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

Eval evaluates the supplied script with an additional script that includes the supplied request and returns the response.

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 EvalOptions

type EvalOptions struct {
	RequestVar          string
	ResponseVar         string
	DesiredOnlyResponse bool
	Debug               DebugOptions
}

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