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 DeleteOperatorAuthForTargetEnvironment(target, environment string) error
- func DeploymentRoot(id DeploymentIdentity) (string, error)
- func SaveDeploymentRecord(record DeploymentRecord) error
- func SetOperatorAuthForTargetEnvironment(target, environment string, auth OperatorAuthEnvironmentConfig) 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
- func ListAllDeployments() ([]DeploymentRecord, error)
- func ListAllDeploymentsForDisplay() ([]DeploymentRecord, []error, error)
- func ListDeployments(target string) ([]DeploymentRecord, error)
- func ListDeploymentsForDisplay(target string) ([]DeploymentRecord, []error, error)
- func LoadDeploymentRecord(id DeploymentIdentity) (DeploymentRecord, error)
- type DeploymentRecordStateError
- type DeploymentSource
- type ObservedDeployment
- type OpenBaoTargetConfig
- type OperatorAuthEnvironmentConfig
- 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 DeleteOperatorAuthForTargetEnvironment ¶ added in v0.4.17
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 SetOperatorAuthForTargetEnvironment ¶ added in v0.4.17
func SetOperatorAuthForTargetEnvironment(target, environment string, auth OperatorAuthEnvironmentConfig) 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 ListAllDeploymentsForDisplay ¶ added in v0.4.16
func ListAllDeploymentsForDisplay() ([]DeploymentRecord, []error, error)
func ListDeployments ¶ added in v0.4.15
func ListDeployments(target string) ([]DeploymentRecord, error)
func ListDeploymentsForDisplay ¶ added in v0.4.16
func ListDeploymentsForDisplay(target string) ([]DeploymentRecord, []error, error)
func LoadDeploymentRecord ¶ added in v0.4.15
func LoadDeploymentRecord(id DeploymentIdentity) (DeploymentRecord, error)
type DeploymentRecordStateError ¶ added in v0.4.16
type DeploymentRecordStateError struct {
Identity DeploymentIdentity
Kind string
Err error
}
func DeploymentRecordState ¶ added in v0.4.16
func DeploymentRecordState(err error) (*DeploymentRecordStateError, bool)
func (*DeploymentRecordStateError) Error ¶ added in v0.4.16
func (e *DeploymentRecordStateError) Error() string
func (*DeploymentRecordStateError) Unwrap ¶ added in v0.4.16
func (e *DeploymentRecordStateError) Unwrap() error
type DeploymentSource ¶ added in v0.4.15
type ObservedDeployment ¶ added in v0.4.15
type OpenBaoTargetConfig ¶ added in v0.4.16
type OpenBaoTargetConfig struct {
RecoveryFile string `yaml:"recovery-file,omitempty" json:"recovery_file,omitempty"`
}
type OperatorAuthEnvironmentConfig ¶ added in v0.4.17
type OperatorAuthEnvironmentConfig struct {
Provider string `yaml:"provider" json:"provider"`
Issuer string `yaml:"issuer" json:"issuer"`
ClientID string `yaml:"client-id" json:"client_id"`
Scopes []string `yaml:"scopes,omitempty" json:"scopes,omitempty"`
CallbackPort int `yaml:"callback-port,omitempty" json:"callback_port,omitempty"`
}
func OperatorAuthForTargetEnvironment ¶ added in v0.4.17
func OperatorAuthForTargetEnvironment(target, environment string) (OperatorAuthEnvironmentConfig, bool, error)
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 defaults to Docker for new local deployment state.
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"`
OpenBao OpenBaoTargetConfig `yaml:"openbao,omitempty" json:"openbao,omitempty"`
OperatorAuth map[string]OperatorAuthEnvironmentConfig `yaml:"operator-auth,omitempty" json:"operator_auth,omitempty"`
}