Documentation
¶
Index ¶
- Constants
- func ApplyRuntimeProviderState(values map[string]string, state RuntimeProviderState) error
- func ApplyRuntimeSelection(values map[string]string, selection RuntimeSelection) error
- func ConfigPath() (string, error)
- func DataRoot() (string, error)
- func DeleteDeploymentRecord(id DeploymentIdentity) error
- func DeploymentRoot(id DeploymentIdentity) (string, error)
- func SaveDeploymentRecord(record DeploymentRecord) error
- func SourceAvailable(source DeploymentSource) bool
- func TargetStateRoot(name string) (string, error)
- func ValidateTargetName(name string) error
- type AccessDefinition
- type AppliedDeployment
- type Config
- type DeploymentIdentity
- type DeploymentRecord
- type DeploymentSource
- type ObservedDeployment
- type PromptConfig
- type ResolvedTarget
- type RuntimeDefinition
- type RuntimeProfile
- type RuntimeProviderState
- type RuntimeSelection
- type TargetAccess
- type TargetDefinition
Constants ¶
const ConfigVersion = 1
const DeploymentRecordVersion = 1
const RuntimeProfileEnvKey = "BASEHARBOR_RUNTIME_PROFILE"
const RuntimeProviderEnvKey = "BASEHARBOR_RUNTIME_PROVIDER"
Variables ¶
This section is empty.
Functions ¶
func ApplyRuntimeProviderState ¶
func ApplyRuntimeProviderState(values map[string]string, state RuntimeProviderState) error
ApplyRuntimeProviderState writes normalized deployment metadata into the supplied state map while preserving unrelated deployment-owned values. Provider-only legacy writers also materialize the standard runtime profile when no profile has been persisted yet, so protected deployment state is a complete provider+profile selection without requiring a migration step.
func ApplyRuntimeSelection ¶
func ApplyRuntimeSelection(values map[string]string, selection RuntimeSelection) error
ApplyRuntimeSelection writes normalized deployment-owned selection while preserving unrelated state such as hostname, TLS, and environment metadata.
func ConfigPath ¶ added in v0.4.15
func DeleteDeploymentRecord ¶ added in v0.4.15
func DeleteDeploymentRecord(id DeploymentIdentity) error
func DeploymentRoot ¶ added in v0.4.15
func DeploymentRoot(id DeploymentIdentity) (string, error)
func SaveDeploymentRecord ¶ added in v0.4.15
func SaveDeploymentRecord(record DeploymentRecord) error
func SourceAvailable ¶ added in v0.4.15
func SourceAvailable(source DeploymentSource) bool
func TargetStateRoot ¶ added in v0.4.15
func ValidateTargetName ¶ added in v0.4.15
Types ¶
type AccessDefinition ¶ added in v0.4.15
type AppliedDeployment ¶ added in v0.4.15
type Config ¶ added in v0.4.15
type Config struct {
Version int `yaml:"version" json:"version"`
DefaultTarget string `yaml:"default-target,omitempty" json:"default_target,omitempty"`
Access map[string]AccessDefinition `yaml:"access,omitempty" json:"access,omitempty"`
Targets map[string]TargetDefinition `yaml:"targets,omitempty" json:"targets,omitempty"`
Prompt PromptConfig `yaml:"prompt,omitempty" json:"prompt,omitempty"`
}
func LoadConfig ¶ added in v0.4.15
func (Config) ResolveTarget ¶ added in v0.4.15
func (c Config) ResolveTarget(explicit, activated string) (ResolvedTarget, error)
func (Config) TargetNames ¶ added in v0.4.15
type DeploymentIdentity ¶ added in v0.4.15
type DeploymentIdentity struct {
Target string `json:"target"`
Application string `json:"application"`
Environment string `json:"environment"`
}
func (DeploymentIdentity) Validate ¶ added in v0.4.15
func (id DeploymentIdentity) Validate() error
type DeploymentRecord ¶ added in v0.4.15
type DeploymentRecord struct {
Version int `json:"version"`
Identity DeploymentIdentity `json:"identity"`
Source DeploymentSource `json:"source"`
Applied AppliedDeployment `json:"applied"`
Observed ObservedDeployment `json:"observed,omitempty"`
}
func ListAllDeployments ¶ added in v0.4.15
func ListAllDeployments() ([]DeploymentRecord, error)
func ListDeployments ¶ added in v0.4.15
func ListDeployments(target string) ([]DeploymentRecord, error)
func LoadDeploymentRecord ¶ added in v0.4.15
func LoadDeploymentRecord(id DeploymentIdentity) (DeploymentRecord, error)
type DeploymentSource ¶ added in v0.4.15
type ObservedDeployment ¶ added in v0.4.15
type PromptConfig ¶ added in v0.4.15
type PromptConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Preset string `yaml:"preset,omitempty" json:"preset,omitempty"`
Position string `yaml:"position,omitempty" json:"position,omitempty"`
Environment string `yaml:"environment,omitempty" json:"environment,omitempty"`
ShowApplication bool `yaml:"show-application,omitempty" json:"show_application,omitempty"`
TextOnly bool `yaml:"text-only,omitempty" json:"text_only,omitempty"`
ProdIndicator string `yaml:"prod-indicator,omitempty" json:"prod_indicator,omitempty"`
Labels map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"`
Colors map[string]string `yaml:"colors,omitempty" json:"colors,omitempty"`
}
type ResolvedTarget ¶ added in v0.4.15
type RuntimeDefinition ¶ added in v0.4.15
type RuntimeDefinition struct {
Provider string `yaml:"provider" json:"provider"`
}
type RuntimeProfile ¶
type RuntimeProfile string
const (
RuntimeProfileStandard RuntimeProfile = "standard"
)
func ParseRuntimeProfile ¶
func ParseRuntimeProfile(value string) (RuntimeProfile, error)
type RuntimeProviderState ¶
type RuntimeProviderState struct {
Provider bhruntime.ProviderKind
}
RuntimeProviderState is deployment-owned provider selection. It is not part of the portable application contract and may differ between deployments of the same logical application.
func RuntimeProviderStateFromValues ¶
func RuntimeProviderStateFromValues(values map[string]string) (RuntimeProviderState, error)
RuntimeProviderStateFromValues reads protected deployment state. Missing provider metadata from v0.3 deployments intentionally defaults to Compose so existing installations remain compatible without a migration.
type RuntimeSelection ¶
type RuntimeSelection struct {
Provider bhruntime.ProviderKind
Profile RuntimeProfile
}
RuntimeSelection is deployment-owned runtime intent. The same portable application contract may use a different selection in each environment.
func RuntimeSelectionFromValues ¶
func RuntimeSelectionFromValues(values map[string]string) (RuntimeSelection, error)
RuntimeSelectionFromValues reads explicit deployment state. Environment names do not imply a provider or profile; selection stays explicit and independently configurable for development, staging, production, or future environments.
type TargetAccess ¶ added in v0.4.15
type TargetAccess struct {
Reference string `yaml:"reference" json:"reference"`
}
type TargetDefinition ¶ added in v0.4.15
type TargetDefinition struct {
Runtime RuntimeDefinition `yaml:"runtime" json:"runtime"`
Access TargetAccess `yaml:"access" json:"access"`
Scope string `yaml:"scope,omitempty" json:"scope,omitempty"`
}