naming

package
v1.12.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package naming holds the module naming rules shared by the side that writes definition names and the side that reads them back: the render service derives {module}-{apiVersion}-{name} when installing a module, and type resolution derives the same string when an Application refers to a module capability. Both must agree exactly, so the derivation lives in one place.

It deliberately imports nothing outside the standard library. pkg/module reaches pkg/appfile transitively (through pkg/definition and pkg/workflow/providers), so pkg/appfile cannot import pkg/module — the same constraint that pkg/module/service/api solves for the renderer interface. A stdlib-only leaf package is importable from either side with no cycle.

Index

Constants

View Source
const (
	// MaxObjectNameLen is the Kubernetes limit for a metadata.name.
	MaxObjectNameLen = 253
	// MaxLabelValueLen is the Kubernetes limit for a label value.
	MaxLabelValueLen = 63
)

Variables

This section is empty.

Functions

func APIVersionPattern

func APIVersionPattern() string

APIVersionPattern returns the source of the apiVersion pattern, for error messages that quote the expected format.

func DefinitionName

func DefinitionName(module, apiVersion, name string) string

DefinitionName derives the installed object name for a module capability. This is the one derivation both the render service and type resolution must agree on: change it here or neither side can find what the other wrote.

func IsValidAPIVersion

func IsValidAPIVersion(s string) bool

IsValidAPIVersion reports whether s is a well-formed module API line version.

func TruncateName

func TruncateName(name string) string

TruncateName keeps a derived definition name within the Kubernetes object-name limit.

func TruncateWithHash

func TruncateWithHash(s string, max int) string

TruncateWithHash keeps s within max bytes, appending a stable 8-char digest of the full value so two long values sharing a prefix stay distinct.

Types

This section is empty.

Jump to

Keyboard shortcuts

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