naming

package module
v0.0.0-...-08a2382 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2026 License: Apache-2.0 Imports: 16 Imported by: 20

Documentation

Index

Constants

View Source
const (
	InlineRecordPrefix = "ocel:"
	InlineRecordOwner  = "ocel-config"
)
View Source
const (
	JSONTypeString  = "string"
	JSONTypeNumber  = "number"
	JSONTypeBoolean = "boolean"
	JSONTypeObject  = "object"
	JSONTypeUnknown = "unknown"
)
View Source
const (
	FieldSeparator = "--"
	WordSeparator  = "-"
	PathSeparator  = "/"
	KeySeparator   = "#"
)
View Source
const (
	UnitEnvironment = "environment"
	UnitEdge        = "edge"
	UnitHostnames   = "hostnames"
	UnitPromotion   = "promotion"
	UnitConnector   = "connector"

	PhaseBuilding     = "building"
	PhaseUploading    = "uploading"
	PhaseProvisioning = "provisioning"
	PhaseFinalizing   = "finalizing"
	PhaseDeleting     = "deleting"

	StageIDLen = 8
)
View Source
const (
	InfraApp = "infra"
)
View Source
const MaxNamespaceField = 12
View Source
const ResourceEnvPrefix = "OCEL_RESOURCE_"
View Source
const WildcardSuffix = "wildcard"

Variables

This section is empty.

Functions

func BindableResourceTypes

func BindableResourceTypes() []resourcesv1.ResourceType

func BindingProperty

func BindingProperty(l *bindingsv1.Binding, name string) (any, bool)

func BindingPropertyNames

func BindingPropertyNames(l *bindingsv1.Binding) []string

func BindingTypes

func BindingTypes() []bindingsv1.BindingType

func BindingVarsKey

func BindingVarsKey(project, class, binding string) string

func DigestTag

func DigestTag(digest string) string

func EnvFragment

func EnvFragment(t bindingsv1.BindingType) string

func Fit

func Fit(max int, separator string, segments ...Segment) string

func ISRTagKey

func ISRTagKey(project string, stack StackName, tag string) string

func ISRTagPrefix

func ISRTagPrefix(project string, stack StackName) string

func InlineRecordName

func InlineRecordName(t resourcesv1.ResourceType, declared string) string

func IsInlineRecord

func IsInlineRecord(name string) bool

func IsRepositorySegment

func IsRepositorySegment(value string) bool

func Join

func Join(separator string, values ...string) string

func NamespaceField

func NamespaceField(namespace string) string

func PhaseID

func PhaseID(unit, phase string) []byte

func ProjectKey

func ProjectKey(project string) string

func ProjectOf

func ProjectOf(key string) (string, error)

func PropertyShapeMessages

func PropertyShapeMessages(shapes []PropertyShape) []*envvarsv1.PropertyShape

func Proxied

func Proxied(t bindingsv1.BindingType) bool

func PulumiProject

func PulumiProject(project string) string

func RepositorySegment

func RepositorySegment(repository string) string

func ResourceEnvName

func ResourceEnvName(t bindingsv1.BindingType, resource string) string

func ResourceID

func ResourceID(kind Kind, name string, parts ...string) string

func ResourceTypeName

func ResourceTypeName(t resourcesv1.ResourceType) string

func ResourceTypeNamed

func ResourceTypeNamed(name string) (resourcesv1.ResourceType, bool)

func Sanitize

func Sanitize(value string) string

func SanitizeAlpha

func SanitizeAlpha(value string) string

func SanitizeHost

func SanitizeHost(hostname string) string

func SessionKeyPrefix

func SessionKeyPrefix(project, env string) string

func StackKey

func StackKey(project string, stack StackName) string

func StateBackendURL

func StateBackendURL(scheme, bucket, project string) string

func Underscore

func Underscore(value string) string

func UnitID

func UnitID(unit string) []byte

func Validate

func Validate(field, value string) error

func ValidateDeploymentID

func ValidateDeploymentID(value string) error

func VarsKey

func VarsKey(project, class string) string

Types

type Coordinate

type Coordinate struct {
	Project string
	Env     string
	App     string
	Kind    Kind
	Name    string
	Release Release
}

func (Coordinate) AssetKey

func (c Coordinate) AssetKey(assetPath string) string

func (Coordinate) BytecodePrefix

func (c Coordinate) BytecodePrefix() string

func (Coordinate) Description

func (c Coordinate) Description(detail string) string

func (Coordinate) FunctionArtifactKey

func (c Coordinate) FunctionArtifactKey(sha string) string

func (Coordinate) ISRPrefix

func (c Coordinate) ISRPrefix() string

func (Coordinate) ImageConfigKey

func (c Coordinate) ImageConfigKey() string

func (Coordinate) PhysicalName

func (c Coordinate) PhysicalName(max int) string

func (Coordinate) PhysicalPrefix

func (c Coordinate) PhysicalPrefix(max int) string

func (Coordinate) SliceName

func (c Coordinate) SliceName() string

func (Coordinate) Stack

func (c Coordinate) Stack() StackName

func (Coordinate) StoragePrefix

func (c Coordinate) StoragePrefix() string

func (Coordinate) Tags

func (c Coordinate) Tags(f Facts) map[string]string

func (Coordinate) Validate

func (c Coordinate) Validate() error

type Facts

type Facts struct {
	ManagedBy  string
	EnvClass   string
	BuildID    string
	Deployment string
	Promotion  string
	Route      string
	ExpiresAt  string
}

type Kind

type Kind string
const (
	KindFunction        Kind = "fn"
	KindWorker          Kind = "worker"
	KindDatabase        Kind = "db"
	KindBucket          Kind = "bucket"
	KindRole            Kind = "role"
	KindQueue           Kind = "queue"
	KindUploadCompleter Kind = "upload-completer"
	KindService         Kind = "svc"
)

func KindOf

func KindOf(t bindingsv1.BindingType) (Kind, bool)

func (Kind) Component

func (k Kind) Component() string

func (Kind) Valid

func (k Kind) Valid() bool

type PropertyShape

type PropertyShape struct {
	Name     string `json:"name"`
	JSONType string `json:"jsonType"`
	List     bool   `json:"list,omitempty"`
}

func BindingPropertyShapes

func BindingPropertyShapes(l *bindingsv1.Binding) []PropertyShape

type Release

type Release struct {
	// contains filtered or unexported fields
}

func NewRelease

func NewRelease(deploymentID, fingerprint string) Release

func ParseRelease

func ParseRelease(value string) (Release, error)

func (Release) IsZero

func (r Release) IsZero() bool

func (Release) String

func (r Release) String() string

type Segment

type Segment struct {
	Value    string
	Priority int
}

func Compressible

func Compressible(value string) Segment

func Fixed

func Fixed(value string) Segment

type StackName

type StackName struct {
	Env     string
	App     string
	Release Release
}

func AppStack

func AppStack(env, app string, release Release) StackName

func InfraStack

func InfraStack(env string) StackName

func ParseStackKey

func ParseStackKey(key string) (string, StackName, error)

func ParseStackName

func ParseStackName(value string) (StackName, error)

func (StackName) IsInfra

func (s StackName) IsInfra() bool

func (StackName) IsZero

func (s StackName) IsZero() bool

func (StackName) String

func (s StackName) String() string

Jump to

Keyboard shortcuts

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