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

labels

package
v0.99.2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package labels matches Kubernetes-style metadata labels via `key` / `key=value` selectors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Selector

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

Selector matches a metadata label by key, and optionally by exact value.

func FirstMatch

func FirstMatch(selectors []Selector, labelSet map[string]string) (Selector, bool)

FirstMatch returns the first selector matching the given label set, if any.

func ParseSelectors

func ParseSelectors(specs []string) ([]Selector, error)

ParseSelectors parses `key` / `key=value` specs into selectors. A bare `key` matches the label regardless of its value; `key=value` requires an exact match. An empty key is rejected.

func (Selector) String

func (s Selector) String() string

Jump to

Keyboard shortcuts

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