Documentation
¶
Overview ¶
Package sites enumerates where things live in loaded collections: root node lists, hook scopes and steps, template sites, written variables and statically resolved request versions. validate and analysis share it so they agree on what a template reads and where it is written.
Index ¶
- func AncestorFolders(c model.Collection, r model.Request) []model.Folder
- func GeneratedVars(n model.Node) map[string]bool
- func HasParam(n model.Node, key string) bool
- func OwnWrites(n model.Node) []string
- func ParamValue(n model.Node, key string) any
- func ParseLabel(s string) *version.Label
- func ResolvedVersion(r model.Request, pinned, prefer string) (model.RequestVersion, bool)
- func SpecsByType() map[model.NodeType]nodes.Spec
- func VisibleDescendants(n model.Node) map[string]bool
- func WrittenVars(list []model.Node) map[string]bool
- type Located
- type NodeList
- type Site
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AncestorFolders ¶
AncestorFolders are the _folder.yaml folders on the way down to r.
func GeneratedVars ¶
GeneratedVars are the variables a node fills with generated values: fresh data, not taken from another step.
func ParamValue ¶
ParamValue is the value of parameter key, or nil.
func ParseLabel ¶
ParseLabel parses a version label; empty or invalid labels give nil.
func ResolvedVersion ¶
ResolvedVersion is the version a node runs without a run preference.
func SpecsByType ¶
SpecsByType indexes the node registry (the single source of parameter rules, plan Decision 17).
func VisibleDescendants ¶
VisibleDescendants are the nodes inside n readable after it: not those of repeated bodies (batch, run_till), which are read through results.
Types ¶
type Located ¶
Located is any value together with the file and YAML path it came from.
func AllNodes ¶
func AllNodes(c model.Collection) []Located[model.Node]
AllNodes flattens NodeLists into individual nodes with their paths.
func HookScopes ¶
func HookScopes(c model.Collection) []Located[model.Hooks]
HookScopes lists every place hooks can be attached, with the YAML path of the mapping that holds the "hooks" key.
type NodeList ¶
NodeList is a list of sibling nodes and the YAML path of the list.
func ChildLists ¶
ChildLists returns the node lists directly inside n (body, branches, then, else, cases); p is n's YAML path. File is left empty.
func ExpandLists ¶
ExpandLists returns l and every node list nested inside its nodes.
func NodeLists ¶
func NodeLists(c model.Collection) []NodeList
NodeLists returns every node list in the collection, top-level and nested inside containers.
func RootLists ¶
func RootLists(c model.Collection) []NodeList
RootLists returns the top-level node lists: each flow's nodes and each hook step's inline nodes. Node ids must be unique within one root.
type Site ¶
type Site struct {
File, Path, Field, Src string
Expression bool // a bare expression (assert check, when), not a {{…}} template
Node string // the node the site belongs to; empty for flow and version sites
}
Site is one template or expression and where it is written.
func FlowTemplates ¶
FlowTemplates are a flow's own templates: input defaults, outputs and the run-till condition.
func NodeTemplates ¶
NodeTemplates covers when, a request node's with values, and the template parameters of inline node types.
func Templates ¶
func Templates(c model.Collection) []Site
Templates lists every template and expression in a collection.
func VersionTemplates ¶
func VersionTemplates(file string, v model.RequestVersion) []Site
VersionTemplates are a request version's templates: url, query, headers, body and asserts.