value

package
v1.235.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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