Documentation
¶
Overview ¶
Package component adapts native configuration services without replacing component engines.
Index ¶
- func DecodeInputs(input *pluginv1.ComponentValue) (map[string]any, error)
- func DecodeObject(input *pluginv1.ComponentValue) (map[string]any, error)
- func DecodeObjectWithSensitiveKeys(input *pluginv1.ComponentValue) (map[string]any, map[string]bool, error)
- func DecodeString(input *pluginv1.ComponentValue) (string, error)
- func DecodeValue(input *pluginv1.ComponentValue) (any, error)
- func DetailError(detail *pluginv1.ErrorDetail, class codes.Code) error
- func DiagnosticError(diagnostic *pluginv1.Diagnostic) error
- func EncodeObject(input any) (*pluginv1.ComponentValue, error)
- func HostLogLevel() string
- func RenderLogs(scope LogScope, entries []*pluginv1.LogEntry)
- func WarnDiagnostic(diagnostic *pluginv1.Diagnostic, warnings ...*WarningDeduper)
- func WithLogScope(ctx context.Context, scope LogScope) context.Context
- type Failure
- type LogScope
- type Provider
- func (p *Provider) ComponentType() string
- func (p *Provider) Discover(ctx context.Context, input *pluginv1.DiscoverComponentsRequest) (*pluginv1.DiscoverComponentsResponse, error)
- func (p *Provider) Identity(ctx context.Context) (string, error)
- func (p *Provider) Prepare(ctx context.Context, input *pluginv1.ComponentRequest) (*pluginv1.PrepareComponentResponse, error)
- func (p *Provider) ResolveState(ctx context.Context, input *pluginv1.ComponentRequest) (*pluginv1.ResolveComponentStateResponse, error)
- func (p *Provider) Supports(capability string) bool
- func (p *Provider) Validate(ctx context.Context, input *pluginv1.ComponentRequest) (*pluginv1.ValidateResponse, error)
- func (p *Provider) ValidateSettings(settings map[string]any) error
- type Registry
- type WarningDeduper
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 ¶
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 ¶
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.
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 ¶
ComponentType identifies the component family this provider supplies.
func (*Provider) Discover ¶
func (p *Provider) Discover(ctx context.Context, input *pluginv1.DiscoverComponentsRequest) (*pluginv1.DiscoverComponentsResponse, error)
Discover resolves instances without replacing their registered execution engine.
func (*Provider) Identity ¶
Identity binds saved plans to executable bytes, schema, and negotiated package metadata.
func (*Provider) Prepare ¶
func (p *Provider) Prepare(ctx context.Context, input *pluginv1.ComponentRequest) (*pluginv1.PrepareComponentResponse, error)
Prepare reevaluates a selected instance after semantic validation. It never executes the returned engine or writes the returned artifacts.
func (*Provider) ResolveState ¶
func (p *Provider) ResolveState(ctx context.Context, input *pluginv1.ComponentRequest) (*pluginv1.ResolveComponentStateResponse, error)
ResolveState obtains backend/workspace identity without discovery or preparation.
func (*Provider) Validate ¶
func (p *Provider) Validate(ctx context.Context, input *pluginv1.ComponentRequest) (*pluginv1.ValidateResponse, error)
Validate returns explicit diagnostics for rendering through the host's masked I/O.
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.
type WarningDeduper ¶
WarningDeduper is owned by one configuration session, so concurrent stack queries cannot hide each other's warnings and its cache leaves with the session.