Documentation
¶
Overview ¶
Package tags provides shared tag/label matching primitives used across Atmos subsystems (auth identities/providers, components, bulk component selection) so every consumer applies the same any/all-match semantics.
Index ¶
- func CollectAvailableTags[T any](items map[string]T, getTags func(T) []string) []string
- func MatchesLabels(labels map[string]string, filterLabels map[string]string) bool
- func MatchesTags(tags []string, filterTags []string, mode TagMode) bool
- func ParseLabelsFlag(input string) (map[string]string, error)
- func ParseTagsFlag(input string) []string
- func SortedKeys(m map[string]string) []string
- func SortedValues(m map[string]string) []string
- func ToStringMap(v any) map[string]string
- func ToStringSlice(v any) []string
- type TagMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectAvailableTags ¶
CollectAvailableTags returns the sorted, deduplicated set of tags across all items, using getTags to extract each item's tags. Used to build "available tags" hints for no-match errors (e.g. auth identities/providers).
func MatchesLabels ¶
MatchesLabels reports whether labels contains every key=value pair in filterLabels (AND). An empty filterLabels always matches (no filter applied).
func MatchesTags ¶
MatchesTags reports whether tags satisfies filterTags under mode. An empty filterTags always matches (no filter applied).
func ParseLabelsFlag ¶
ParseLabelsFlag parses a comma-separated key=value list into a map[string]string.
func ParseTagsFlag ¶
ParseTagsFlag parses a comma-separated tags string into a trimmed, non-empty slice.
func SortedKeys ¶
SortedKeys returns the sorted keys of a map[string]string.
func SortedValues ¶
SortedValues returns the values of a map[string]string, ordered by key for deterministic output (map iteration order is randomized in Go).
func ToStringMap ¶
ToStringMap coerces a YAML-decoded value (typically map[string]any) into a map[string]string, skipping any non-string values. Returns an empty (non-nil) map for nil/invalid input so callers always get a rangeable value.
func ToStringSlice ¶
ToStringSlice coerces a YAML-decoded value (typically []any) into a []string, skipping any non-string elements. Returns an empty (non-nil) slice for nil/invalid input so callers always get a rangeable value.