tagmatch

package
v0.4.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tagmatch provides shared, allocation-free validation and hierarchical parent matching for dotted gameplay tag names.

Index

Constants

View Source
const (
	// MaxNameLength is the maximum byte length of a valid gameplay tag name.
	MaxNameLength = 256
	// MaxDepth is the maximum number of dot-separated segments in a valid gameplay tag name.
	MaxDepth = 32
)

Variables

This section is empty.

Functions

func HasTag

func HasTag(held []string, query string) bool

HasTag reports whether any entry in held matches query under gameplay-tag hierarchy.

func Matches

func Matches(held, query string) bool

Matches reports whether held matches query under gameplay-tag hierarchy: held equals query, or held is a descendant of query (starts with query followed by '.'). Both held and query must be non-empty.

func Parent

func Parent(name string) string

Parent returns the immediate parent of name (everything before the last '.'), or "" when name has no '.'.

func ValidName

func ValidName(name string) bool

ValidName reports whether name is a valid dotted gameplay tag: 1 to MaxDepth dot-separated segments (at most MaxNameLength bytes total), each starting with an ASCII letter followed by ASCII letters, digits, '_' or '-'.

Types

This section is empty.

Jump to

Keyboard shortcuts

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