sessionlabel

package
v0.70.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package sessionlabel defines the bounded, case-insensitive label semantics shared by daemon mutation and CLI filtering.

Index

Constants

View Source
const (
	MaxBytes      = 64
	MaxPerSession = 32
)

Variables

This section is empty.

Functions

func Apply

func Apply(existing, add, remove []string) ([]string, error)

Apply returns the label set produced by atomically removing then adding the requested identities. Existing display spellings win over add spellings.

func Contains

func Contains(labels []string, candidate string) bool

Contains reports whether labels contains candidate under label identity rules. Callers should normalize user input before using it as candidate.

func ContainsAll

func ContainsAll(labels, requested []string) bool

ContainsAll reports whether labels contains every requested identity.

func Equal

func Equal(a, b string) bool

Equal reports whether two normalized label spellings identify the same label. EqualFold is locale-independent Unicode simple case folding.

func Normalize

func Normalize(labels []string) ([]string, error)

Normalize trims, validates, and case-insensitively deduplicates labels while preserving the first display spelling. It always returns a non-nil slice on success so callers can expose an explicit empty JSON array.

Types

This section is empty.

Jump to

Keyboard shortcuts

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