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

extract

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: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VendorTypeComponent is the type for components with component manifests.
	VendorTypeComponent = "Component Manifest"
	// VendorTypeVendor is the type for vendor manifests.
	VendorTypeVendor = "Vendor Manifest"
)

Variables

This section is empty.

Functions

func Affected added in v1.203.0

func Affected(affected []schema.Affected, flattenDependents bool) []map[string]any

Affected transforms a slice of schema.Affected into []map[string]any for the renderer. If flattenDependents is true, dependents are flattened into separate rows with is_dependent=true.

func Components

func Components(stacksMap map[string]any) ([]map[string]any, error)

Components transforms stacksMap into structured component data. Returns []map[string]any suitable for the renderer pipeline.

func ComponentsForStack

func ComponentsForStack(stackName string, stacksMap map[string]any) ([]map[string]any, error)

ComponentsForStack extracts components for a specific stack only.

func GetLabelsFromMetadata added in v1.225.0

func GetLabelsFromMetadata(metadata map[string]any) map[string]string

GetLabelsFromMetadata extracts metadata.labels as a map[string]string for callers outside package extract. Returns an empty (non-nil) map when absent or not an object.

func GetTagsFromMetadata added in v1.225.0

func GetTagsFromMetadata(metadata map[string]any) []string

GetTagsFromMetadata extracts metadata.tags as a []string for callers outside package extract (e.g. cmd/list sources, pkg/list/dependencies). Returns an empty (non-nil) slice when absent or not a list.

func Instances

func Instances(instances []schema.Instance) []map[string]any

ExtractInstances transforms schema.Instance slice into []map[string]any for renderer. Converts structured Instance objects into flat maps accessible by column templates.

func Metadata

func Metadata(instances []schema.Instance) []map[string]any

Metadata transforms a slice of schema.Instance into []map[string]any for the renderer. It extracts metadata fields and makes them accessible to column templates.

func Stacks

func Stacks(stacksMap map[string]any, tagsFilter []string, labelsFilter map[string]string) ([]map[string]any, error)

Stacks transforms stacksMap into structured stack data. It returns []map[string]any suitable for the renderer pipeline. Exposes vars from components for template access (e.g., {{ .vars.namespace }}). When tagsFilter/labelsFilter are non-empty, only stacks where at least one component independently satisfies both filters (tags: any-match, labels: all-match) are returned — union semantics across the stack's components.

func StacksForComponent

func StacksForComponent(componentName string, stacksMap map[string]any, tagsFilter []string, labelsFilter map[string]string) ([]map[string]any, error)

StacksForComponent extracts stacks that contain a specific component. When tagsFilter/labelsFilter are non-empty, only stacks where that specific component's own metadata.tags/metadata.labels satisfy the filters are returned. ErrNoStacksFound is reserved for "component not found in any stack"; a component that exists but matches no filter yields an empty result with no error.

func StacksMatrixEntries added in v1.216.0

func StacksMatrixEntries(stacksMap map[string]any) []matrix.Entry

StacksMatrixEntries extracts all stack+component pairs from stacksMap as matrix entries. Each entry includes stack, component, component_path, and component_type — matching the format used by describe affected --format=matrix.

func UniqueComponents added in v1.204.0

func UniqueComponents(stacksMap map[string]any, stackPattern string) ([]map[string]any, error)

UniqueComponents extracts deduplicated components from all stacks. Returns unique component names with aggregated metadata (stack count, types). This is the original behavior of "list components" - showing unique component definitions. The stackPattern parameter is an optional glob pattern to filter which stacks to consider.

func Vendor

func Vendor(vendorInfos []VendorInfo) ([]map[string]any, error)

Vendor transforms vendorInfos into structured data. Returns []map[string]any suitable for the renderer pipeline.

func Workflows

func Workflows(atmosConfig *schema.AtmosConfiguration, fileFilter string) ([]map[string]any, error)

ExtractWorkflows transforms workflow manifests into structured data. Returns []map[string]any suitable for the renderer pipeline.

Types

type GetVendorInfosFunc

type GetVendorInfosFunc func(*schema.AtmosConfiguration) ([]VendorInfo, error)

GetVendorInfosFunc is a function type for getting vendor information. This allows the extract package to avoid importing the list package.

type VendorInfo

type VendorInfo struct {
	Component string
	Type      string
	Manifest  string
	Folder    string
	Tags      []string
}

VendorInfo holds information about a vendor component.

Jump to

Keyboard shortcuts

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