value

package
v1.233.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package value provides host-independent Starlark compilation and read-only values. It does not import the script host, CI, or policy packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile

func Compile(source, filename string, line int32, globals starlark.StringDict) (*starlark.Program, error)

Compile wraps a parsed function body without changing authored source locations. No load statements are allowed inside the resulting function.

func Result

func Result(v starlark.Value) (any, error)

Result converts a Starlark result into detached native values.

Types

type ItemErrors

type ItemErrors struct {
	// contains filtered or unexported fields
}

ItemErrors records the first failure hit while enumerating a mapping through Items, which cannot return an error itself. EvaluateValue surfaces it once the script returns.

func Globals

func Globals(values ValueMap) (starlark.StringDict, *ItemErrors)

Globals creates fresh read-only context bindings and a deferred conversion error sink.

func (*ItemErrors) Err

func (s *ItemErrors) Err() error

Err reports errors from mapping enumeration, whose Starlark API cannot return errors.

type StaticMap

type StaticMap map[string]any

StaticMap exposes already materialized data through ValueMap. Callers own isolation.

func (StaticMap) Get

func (m StaticMap) Get(key string) (any, bool, error)

func (StaticMap) Keys

func (m StaticMap) Keys() []string

type ValueMap

type ValueMap interface {
	Keys() []string
	Get(string) (any, bool, error)
}

ValueMap supplies read-only values. Policy callers must supply materialized data.

Jump to

Keyboard shortcuts

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