runtime

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSource

type DataSource interface {
	// Get retrieves a value from the data source by path.
	// Path is a dot-separated string (e.g., "path.id", "query.page").
	// Returns the value and true if found, nil and false otherwise.
	Get(path string) (any, bool)
}

DataSource represents a source of data for runtime expressions.

type EnvSource

type EnvSource struct {
	Env map[string]string
}

EnvSource provides access to environment variables.

func (*EnvSource) Get

func (e *EnvSource) Get(path string) (any, bool)

type Evaluator

type Evaluator interface {
	AddSource(name string, source DataSource)
	Evaluate(expr string) (any, error)
}

Evaluator evaluates runtime expressions using available data sources.

func NewEvaluator

func NewEvaluator() Evaluator

type RequestSource

type RequestSource struct {
	PathParams  map[string]string
	QueryParams map[string][]string
	Headers     map[string][]string
	Body        any
	Cookies     map[string]string
}

RequestSource provides access to request data.

func (*RequestSource) Get

func (r *RequestSource) Get(path string) (any, bool)

type StateSource

type StateSource struct {
	Data map[string]any
}

StateSource provides access to server state.

func (*StateSource) Get

func (s *StateSource) Get(path string) (any, bool)

Jump to

Keyboard shortcuts

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