scope

package
v6.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 2 Imported by: 0 modules, 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 scope keeps the targets an environment or a step selects in one form per file.

The platform stores one scope and reports it twice: as `predicate`, and, when it is a query, the same query again as `query`. Sent both, it takes `query` and ignores `predicate`. A file holding both would hide an edit to `predicate` behind the unchanged `query`, so files hold `query` when the platform reports one, and `predicate`, which is deprecated, only for a scope that has no query.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Comparable

func Comparable(local, remote *jsyaml.Map, holders func(*jsyaml.Map) []Holder) []string

Comparable makes the scopes of a file and of the platform's version comparable by the platform's rule: a file holding `query` is compared by its query alone; one without is compared by its predicate, whatever query the platform derived from it. It returns a hint for each scope the file still selects with a predicate while the platform holds a query, naming the query to use instead.

func ForFile

func ForFile(doc *jsyaml.Map, holders func(*jsyaml.Map) []Holder)

ForFile leaves one form of each scope in a document the platform returned: `query` when it holds one, `predicate` otherwise.

func HasQuery

func HasQuery(m *jsyaml.Map) bool

HasQuery tells whether a scope holds a query, which the platform takes over any predicate beside it. An empty query is one too: it selects every target.

Types

type Holder

type Holder struct {
	// Path is how messages name it: "" for the document itself, or
	// "lanes[0].steps[1].radius".
	Path string
	Map  *jsyaml.Map
}

Holder is a map holding a scope, and where in its document it sits.

func Environment

func Environment(doc *jsyaml.Map) []Holder

Environment finds the scope of an environment: the document itself.

func Steps

func Steps(doc *jsyaml.Map) []Holder

Steps finds the scopes of an experiment or a template: each step's radius.

Jump to

Keyboard shortcuts

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