id

package
v0.0.0-...-35dcf12 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTag         = "default"
	TagSeparator       = ":"
	NamespaceSeparator = "/"
)

Variables

This section is empty.

Functions

func ExtractAlias

func ExtractAlias(identifier string) string

ExtractAlias returns just the alias portion from an identifier (namespace/alias or alias).

func Generate

func Generate() string

func ParseName

func ParseName(input string) (identifier string, tag *string, err error)

ParseName parses and validates "namespace/alias:tag" or "alias:tag". Returns the cleaned identifier (namespace/alias or alias) and optional tag. All components are validated and normalized (lowercase, trimmed).

func SplitIdentifier

func SplitIdentifier(identifier string) (namespace *string, alias string)

SplitIdentifier splits "namespace/alias" into its parts. Returns nil namespace for bare aliases, pointer for explicit namespace.

func ValidateAndDeduplicateTags

func ValidateAndDeduplicateTags(tags []string) ([]string, error)

func ValidateNamespaceMatchesTeam

func ValidateNamespaceMatchesTeam(identifier, teamSlug string) error

ValidateNamespaceMatchesTeam checks if an explicit namespace in the identifier matches the team's slug. Returns an error if the namespace doesn't match. If the identifier has no explicit namespace, returns nil (valid).

func ValidateSandboxID

func ValidateSandboxID(sandboxID string) error

ValidateSandboxID checks that a sandbox ID contains only lowercase alphanumeric characters.

func WithNamespace

func WithNamespace(namespace, alias string) string

WithNamespace returns identifier with the given namespace prefix.

func WithTag

func WithTag(identifier, tag string) string

WithTag returns the identifier with the given tag appended (e.g. "templateID:tag").

Types

This section is empty.

Jump to

Keyboard shortcuts

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