component

package
v1.235.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 37 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package component adapts native configuration services without replacing component engines.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeInputs

func DecodeInputs(input *pluginv1.ComponentValue) (map[string]any, error)

DecodeInputs adapts the evaluated variables of a component. It behaves like DecodeObject, but a value that is not yet known is a defect of the plugin that the user must be able to trace, so the error names the input and the path of the unknown value inside it. It never prints a value.

func DecodeObject

func DecodeObject(input *pluginv1.ComponentValue) (map[string]any, error)

DecodeObject adapts a fully evaluated object for Atmos's existing stack/varfile APIs. Unknown values must remain in the evaluator until preparation can resolve them. Sensitivity paths are validated and registered with masked I/O before values escape.

func DecodeObjectWithSensitiveKeys

func DecodeObjectWithSensitiveKeys(input *pluginv1.ComponentValue) (map[string]any, map[string]bool, error)

DecodeObjectWithSensitiveKeys retains validated sensitivity paths as top-level input keys. Terraform partitions whole variables, so a sensitive descendant makes its containing input sensitive even when it has no non-empty leaves.

func DecodeString

func DecodeString(input *pluginv1.ComponentValue) (string, error)

DecodeString reads a fully evaluated string value. Sensitivity paths are registered with masked I/O before the text escapes, so a secret carried this way never reaches output unmasked.

func DecodeValue

func DecodeValue(input *pluginv1.ComponentValue) (any, error)

DecodeValue adapts one fully evaluated value of any type, such as an entry of a value map. A null value decodes to nil.

func DetailError

func DetailError(detail *pluginv1.ErrorDetail, class codes.Code) error

DetailError renders a plugin's structured failure with the Atmos error builder: the headline as the message, an explanation naming the unit, stack, file, setting, and operation, the plugin's hints, and the detail text when the plugin marked it safe. Detail text that is not safe stays out of the error and goes to the masked debug log. Every field passes through secret masking before display.

func DiagnosticError

func DiagnosticError(diagnostic *pluginv1.Diagnostic) error

DiagnosticError converts one plugin diagnostic into an error, or nil for a warning.

func EncodeObject

func EncodeObject(input any) (*pluginv1.ComponentValue, error)

EncodeObject encodes host settings without passing through protobuf floating point values.

func HostLogLevel

func HostLogLevel() string

HostLogLevel returns the Atmos log level in the vocabulary of the plugin protocol, so a plugin can skip events nobody will see. A level above error means off.

func RenderLogs

func RenderLogs(scope LogScope, entries []*pluginv1.LogEntry)

RenderLogs shows a plugin's log events through the Atmos logger, on the UI channel (stderr), scoped to the component and stack of the call. The Atmos log level decides what is visible: the logger drops events below it. Messages and field values are masked. Rendering never fails the call. A warning or error that was already shown for the same component and stack in this invocation is not shown again.

func WarnDiagnostic

func WarnDiagnostic(diagnostic *pluginv1.Diagnostic, warnings ...*WarningDeduper)

WarnDiagnostic prints a warning-severity diagnostic on the UI channel with secrets masked.

func WithLogScope

func WithLogScope(ctx context.Context, scope LogScope) context.Context

WithLogScope names the component and stack that log events delivered during a call belong to. A plugin delivers its log events while the call runs, so the call must carry the scope; a call without one is scoped to the plugin alone.

Types

type Failure

type Failure struct {
	Detail *pluginv1.ErrorDetail
	// contains filtered or unexported fields
}

Failure is a plugin failure that carries the plugin's structured description. Its message is the plugin's headline with secrets masked; it unwraps to the Atmos sentinel for the failure class.

func (*Failure) Error

func (f *Failure) Error() string

Error returns the masked headline.

func (*Failure) Unwrap

func (f *Failure) Unwrap() error

Unwrap exposes the sentinel so errors.Is keeps classifying the failure.

type LogScope

type LogScope struct {
	Provider  string
	Component string
	Stack     string
	Warnings  *WarningDeduper
}

LogScope identifies the call a plugin's log events belong to.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider owns the verified definition of one configuration provider.

func (*Provider) ComponentType

func (p *Provider) ComponentType() string

ComponentType identifies the component family this provider supplies.

func (*Provider) Discover

Discover resolves instances without replacing their registered execution engine.

func (*Provider) Identity

func (p *Provider) Identity(ctx context.Context) (string, error)

Identity binds saved plans to executable bytes, schema, and negotiated package metadata.

func (*Provider) Prepare

Prepare reevaluates a selected instance after semantic validation. It never executes the returned engine or writes the returned artifacts.

func (*Provider) ResolveState

ResolveState obtains backend/workspace identity without discovery or preparation.

func (*Provider) Supports

func (p *Provider) Supports(capability string) bool

Supports reports an independently negotiated configuration capability.

func (*Provider) Validate

Validate returns explicit diagnostics for rendering through the host's masked I/O.

func (*Provider) ValidateSettings

func (p *Provider) ValidateSettings(settings map[string]any) error

ValidateSettings checks provider settings without starting its executable.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry is an immutable invocation-local collection of configuration providers. It never mutates the global component execution registry.

func NewRegistry

func NewRegistry(activations []*extension.Activation) (*Registry, error)

NewRegistry validates the entire batch before making any provider available.

func (*Registry) Get

func (r *Registry) Get(name string) (*Provider, bool)

Get looks up a configuration provider by export name.

func (*Registry) Names

func (r *Registry) Names() []string

Names returns a deterministic copy of the registered provider names.

type WarningDeduper

type WarningDeduper struct {
	sync.Mutex
	// contains filtered or unexported fields
}

WarningDeduper is owned by one configuration session, so concurrent stack queries cannot hide each other's warnings and its cache leaves with the session.

Jump to

Keyboard shortcuts

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