oprefs

package
v0.2.17 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package oprefs resolves `op://NAME` symbolic references in txcl rule bodies to concrete URLs based on a workspace's operations registry.

Substitution runs at apply time on the CLI side: the chassis only ever sees resolved URLs. This keeps the chassis simple and means a `txco diff` against an older chassis still works.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasRefs

func HasRefs(txcl string) bool

HasRefs reports whether txcl contains any `"op://..."` reference. Faster than calling References when the caller only needs a yes/no.

func References

func References(txcl string) []string

References returns the distinct list of op names referenced inside `"op://..."` literals in txcl. Useful for pre-validating a bundle before substitution, so a config-shape error surfaces before parse validation.

func ResolveOpRefs

func ResolveOpRefs(txcl string, ops map[string]Operation) (string, error)

ResolveOpRefs scans txcl for `"op://NAME"` literals and replaces each with `"<resolved-url>"` looked up in ops. Returns an error on the first unresolved name.

Types

type Operation

type Operation struct {
	URL string
}

Operation is the minimum shape resolveOpRefs cares about. The full schema (with optional auth fields, etc.) lives in chassis/cli but isn't imported here to avoid a cycle.

Jump to

Keyboard shortcuts

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