Help us shape the future of Go! Take the 2026 Go Developer Survey

composition

package
v1.233.1 Latest Latest
Warning

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

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

Documentation

Overview

Package composition validates component membership in named compositions.

A composition groups multiple services into one system. Components join a composition via their first-class `composition:` field. Membership is a closed contract (a component may only claim a service the composition declares) but fulfillment is open (a declared service with no component in a given stack is allowed).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteLifecycle added in v1.223.0

func ExecuteLifecycle(ctx context.Context, info *schema.ConfigAndStacksInfo, verb, name string, flags map[string]any) error

ExecuteLifecycle runs a provider-backed lifecycle/read command against one composition or all compositions fulfilled in the selected stack.

func ExecuteValidate

func ExecuteValidate(_ context.Context, info *schema.ConfigAndStacksInfo, name string) error

ExecuteValidate produces a soft report of which composition services are fulfilled and which are not provided in a stack, and surfaces any unknown members (which are hard errors enforced during component execution).

func ListRows added in v1.224.0

func ListRows(_ context.Context, info *schema.ConfigAndStacksInfo) ([]map[string]any, error)

ListRows returns composition inventory rows. Without a stack, every declared composition includes the stacks that fulfill at least one of its services. With a stack, rows include fulfillment diagnostics for that stack.

func ValidateMembership

func ValidateMembership(componentName, compositionName string, compositions map[string]schema.Composition) error

ValidateMembership checks that a component claiming membership in a composition is allowed: the composition must exist and must declare the component's name in its services list. Returns a hard error otherwise. An empty composition name is valid (no membership).

Types

type Report

type Report struct {
	Composition string
	Description string
	Fulfilled   []string // declared services that a component provides in this stack
	NotProvided []string // declared services with no component in this stack
	Unknown     []string // members claimed by components but not declared (hard errors)
}

Report describes which declared services of a composition are fulfilled by components in a stack and which are not provided there.

func Validate

func Validate(compositionName string, members []string, compositions map[string]schema.Composition) (Report, error)

Validate builds a soft Report for a composition given the set of component names that claim membership in it within a stack. Members not declared by the composition are surfaced in Unknown (these are hard errors elsewhere).

Jump to

Keyboard shortcuts

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