oprefs

package
v0.2.46 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 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

View Source
const MalformedHint = "an op:// name is letters, digits, '_' and '-' only (no '/' or '.'), so this ref can never resolve — rename the operation"

MalformedHint explains a MalformedExecRefs result.

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 MalformedExecRefs added in v0.2.44

func MalformedExecRefs(txcl string) []string

MalformedExecRefs returns the distinct `op://…` EXEC operands in txcl whose name opRefRE can never match (`EXEC "op://ssr/render"`). Such a ref is never resolved at apply and never flagged by HasRefs, so the stack would activate and then fail at the rule's first dispatch as an unsupported EXEC value. Only EXEC operands count: an op:// string used as data (a secret manager's reference, say) is the author's business.

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