resolution

package
v1.203.0-test.7 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear()

Clear clears the resolution context for the current goroutine.

func Scoped

func Scoped() func()

Scoped creates a new scoped resolution context and returns a restore function. This prevents memory leaks and cross-call contamination by ensuring contexts are cleaned up. Usage:

restoreCtx := resolution.Scoped()
defer restoreCtx()

Types

type Context

type Context struct {
	CallStack []DependencyNode
	Visited   map[string]bool // Map of "stack-component" to track visited nodes.
}

Context tracks the call stack during YAML function resolution to detect circular dependencies.

func GetOrCreate

func GetOrCreate() *Context

GetOrCreate gets or creates a resolution context for the current goroutine.

func NewContext

func NewContext() *Context

NewContext creates a new resolution context for cycle detection.

func (*Context) Clone

func (ctx *Context) Clone() *Context

Clone creates a copy of the resolution context for use in concurrent operations.

func (*Context) Pop

func (ctx *Context) Pop(atmosConfig *schema.AtmosConfiguration)

Pop removes the top node from the call stack.

func (*Context) Push

func (ctx *Context) Push(atmosConfig *schema.AtmosConfiguration, node DependencyNode) error

Push adds a node to the call stack and checks for circular dependencies.

type DependencyNode

type DependencyNode struct {
	Component    string
	Stack        string
	FunctionType string // "terraform.state", "terraform.output", "atmos.Component".
	FunctionCall string // Full function call for error reporting.
}

DependencyNode represents a single node in the dependency resolution chain.

Jump to

Keyboard shortcuts

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