validate

package
v0.38.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const MaxNameLen = 255

MaxNameLen is the maximum allowed length for a template name.

Variables

View Source
var ErrInvalidName = errors.New("invalid name")

ErrInvalidName indicates a name failed validation.

View Source
var ReservedGeneratorNames = []string{"list", "ls", "info", "agent-file"}

ReservedGeneratorNames are names that conflict with "tag generate" subcommands and cannot be used as generator or bundle names.

Functions

func GeneratorName

func GeneratorName(name string) error

GeneratorName validates a name for use as a generator or bundle name. It applies PathSegmentSafe checks and rejects names that conflict with "tag generate" subcommands (list, ls, info, agent-file).

func PathSegmentSafe

func PathSegmentSafe(name string) error

PathSegmentSafe checks that a string is safe to use as a single path segment. It rejects empty/whitespace-only values, "." and "..", path separators, and path traversal sequences.

func TemplateName

func TemplateName(name string) error

TemplateName validates a name for use as a template/library directory name. It applies PathSegmentSafe checks plus additional constraints: max length, no dot prefix, and no control characters.

Types

This section is empty.

Jump to

Keyboard shortcuts

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