naming

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package naming provides deterministic names and domains for Lesser deployments.

Index

Constants

View Source
const DefaultAppName = "lesser"

DefaultAppName is used when an explicit app name is not provided.

Variables

This section is empty.

Functions

func GlobalResourceName

func GlobalResourceName(app string, stage Stage, resource string, accountID string, region string) string

GlobalResourceName returns "<app>-<stage>-<resource>-<account>-<region>".

func IsLiveEnvironment

func IsLiveEnvironment(environment string) bool

IsLiveEnvironment returns true when the provided environment maps to the live stage.

func IsLiveStage

func IsLiveStage(stage Stage) bool

IsLiveStage returns true when the stage is live.

func NormalizeAppName

func NormalizeAppName(app string) (string, error)

NormalizeAppName validates and normalizes an app slug.

func ResourceName

func ResourceName(resource string, environment string) string

ResourceName returns "<default-app>-<stage>-<resource>" using a loosely-typed environment string.

func ResourceNameWithApp

func ResourceNameWithApp(app string, resource string, environment string) string

ResourceNameWithApp returns "<app>-<stage>-<resource>" using a loosely-typed environment string.

func S3BucketName

func S3BucketName(app string, stage Stage, bucketPurpose string, accountID string, region string) string

S3BucketName returns a deterministic S3 bucket name, including account and region for global uniqueness.

func ServiceDomain

func ServiceDomain(service string, stage Stage, baseDomain string) string

ServiceDomain returns "<service>.<stage-domain>", where stage-domain is derived by StageDomain.

func SharedResourceName

func SharedResourceName(app string, resource string) string

SharedResourceName returns "<app>-shared-<resource>".

func SharedStackName

func SharedStackName(app string) string

SharedStackName returns "<app>-shared".

func StageDomain

func StageDomain(stage Stage, baseDomain string) string

StageDomain returns the stage domain. Live uses the base domain, other stages use "<stage>.<base-domain>".

func StageResourceName

func StageResourceName(app string, stage Stage, resource string) string

StageResourceName returns "<app>-<stage>-<resource>".

func StageStackName

func StageStackName(app string, stage Stage) string

StageStackName returns "<app>-<stage>".

Types

type Stage

type Stage string

Stage identifies a deployment stage.

const (
	StageDev     Stage = "dev"
	StageStaging Stage = "staging"
	StageLive    Stage = "live"
	StageShared  Stage = "shared"
)

Supported deployment stages.

func StageForEnvironment

func StageForEnvironment(environment string) Stage

StageForEnvironment maps common environment aliases to canonical deployment stages.

Jump to

Keyboard shortcuts

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