api

package module
v1.0.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

README

Universal Ferret API

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OptimizationLevel

type OptimizationLevel int
const (
	OptimizationNone OptimizationLevel = iota
	OptimizationBasic
	OptimizationFull
	OptimizationAggressive
)

type Output

type Output = result.Output

type Plan

type Plan interface {
	io.Closer
	Params() []string
	NewSession(ctx context.Context, opts ...SessionOption) (Session, error)
	NewDebugSession(ctx context.Context, opts ...SessionOption) (debugger.Session, error)
}

type PlanOption

type PlanOption func(PlanOptions) error

func WithOptimizationLevel

func WithOptimizationLevel(level OptimizationLevel) PlanOption

WithOptimizationLevel sets the optimization level for the execution plan.

type PlanOptions

type PlanOptions interface {
	SetOptimizationLevel(OptimizationLevel) error
}

type Runtime

type Runtime interface {
	io.Closer
	Run(ctx context.Context, src source.File, opts ...SessionOption) (result.Output, error)
	Compile(ctx context.Context, src source.File, opts ...PlanOption) (Plan, error)
	CompileDebug(ctx context.Context, src source.File, opts ...PlanOption) (Plan, error)
}

type Session

type Session interface {
	io.Closer
	Run(c context.Context) (result.Output, error)
}

type SessionOption

type SessionOption func(SessionOptions) error

func WithOutputContentType

func WithOutputContentType(contentType string) SessionOption

WithOutputContentType selects the output codec content type for session results.

func WithParam

func WithParam(key string, value any) SessionOption

WithParam sets a session parameter for the execution.

func WithParams

func WithParams(params map[string]any) SessionOption

WithParams merges the provided parameter map into the session environment, overriding existing keys while preserving any other previously defined parameters.

type SessionOptions

type SessionOptions interface {
	SetParam(string, any) error
	SetParams(map[string]any) error
	SetOutputContentType(string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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