refcache

package
v1.233.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package refcache defines the key shared by the process-wide caches behind Terraform references: !terraform.state, !terraform.output, and atmos.Component.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthScope

func AuthScope(authContext *schema.AuthContext, authManager any, disabled bool) any

AuthScope partitions cached values by the authentication actually supplied to a lookup. A target component can use a different identity from its caller, and identity names alone are not unique across independently configured managers. It returns nil when the caller supplies no credentials and authentication is not disabled.

func DeleteTarget

func DeleteTarget(cache *sync.Map, stack, component string)

DeleteTarget removes every cached variant of one target from a cache keyed by Key, whatever its credentials, inspection mode, or describe mode.

Types

type Key

type Key struct {
	BasePath, ConfigPath string // Configuration root (HEAD vs BASE in describe affected).
	Stack, Component     string // Target.
	Invocation           any    // ac.AuthManager; separates deferred invocations.
	Auth                 any    // Caller credentials, from AuthScope.
	Inspection           bool   // Masked placeholders vs resolved values.
	RawDescribe          bool   // Target described without YAML functions.
}

Key identifies one Terraform reference lookup in a process-wide cache. Every field changes the cached result, and the key is always comparable.

func NewKey

func NewKey(ac *schema.AtmosConfiguration, stack, component string) Key

NewKey returns the key for a target, filled with the configuration root and invocation. Callers set Auth, Inspection, and RawDescribe on the result as needed.

type Kinds

type Kinds struct {
	Component, State, StaticState string
}

Kinds names the invocation-local value-cache entries used by one mode.

func KindsFor

func KindsFor(inspection bool) Kinds

KindsFor returns the value-cache kinds for inspection (masked placeholders) or execution (resolved values). The two never share a kind.

Jump to

Keyboard shortcuts

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