tags

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 5 Imported by: 0

README

Tags

This package defines the product contract for user-provided tags used across mutable Hypeman resources.

What Tags Are

Tags are optional string key/value pairs that let users label resources for ownership, environment, automation, and filtering.

Domain code uses the shared tags.Tags type alias so resource packages reference one tags type consistently.

Examples:

  • team=backend
  • env=staging
  • cost_center=ml-platform

Contract

  • Type: map[string]string
  • Maximum entries per resource: 50
  • Key length: 1..128
  • Value length: 0..256
  • Allowed characters in keys/values: [A-Za-z0-9 _.:/=+@-]

Behavior

  • Tags are optional.
  • Tag filters use exact, case-sensitive matching.
  • Multiple filter pairs are ANDed together.
  • Resources with no tags do not match non-empty tag filters.

API Expectations

  • Create endpoints accept optional tags.
  • Get/List responses include tags when present.
  • List endpoints support filtering by tags[...] where enabled.

Documentation

Index

Constants

View Source
const (
	MaxEntries     = 50
	MinKeyLength   = 1
	MaxKeyLength   = 128
	MinValueLength = 0
	MaxValueLength = 256
)

Variables

View Source
var ErrInvalidTags = errors.New("invalid tags")

Functions

func Matches

func Matches(resource Tags, filter Tags) bool

Matches returns true when resource tags satisfy all filter pairs.

func Validate

func Validate(resourceTags Tags) error

Validate enforces tag constraints for all mutable resources.

Types

type Tags

type Tags = map[string]string

Tags is the shared domain type for resource tags.

func Clone

func Clone(resourceTags Tags) Tags

Clone returns a deep copy of a tag map and normalizes empty maps to nil.

Jump to

Keyboard shortcuts

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