Help us shape the future of Go! Take the 2026 Go Developer Survey

fn

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 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 {
	fnv1.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 *fnv1.RunFunctionRequest, script string, opts EvalOptions) (*fnv1.RunFunctionResponse, error)

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 *fnv1.RunFunctionRequest) (outRes *fnv1.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