Documentation
¶
Index ¶
- Constants
- Variables
- func AddConnectivityRule(rule ConnectivityRule) error
- func ApplicationBackendNetworkName(m Manifest) string
- func ApplicationExposureNetworkName(m Manifest) string
- func CapabilityBindings(m Manifest) ([]capability.Binding, error)
- func CheckApplicationConnectivityReleased(m Manifest) error
- func CheckControlPlaneDestroySafe() error
- func CheckManagedRuntimeDefinition(files RuntimeFiles, m Manifest) error
- func CheckReferenceProviderRegistry(m Manifest) error
- func CheckRuntimePermissions(files RuntimeFiles) error
- func CheckSupportedRuntimeServices(m Manifest) error
- func ConfiguredRuntimeAPIURL() (string, bool, error)
- func ConnectivityNetworkName(rule ConnectivityRule) string
- func ConnectivityRuleID(rule ConnectivityRule) string
- func ConnectivityTargetAlias(rule ConnectivityRule) string
- func DefaultProviderPlacement(provider capability.ProviderKind) (capability.ProviderPlacement, error)
- func EnsureRuntimeIdentity(m Manifest, files RuntimeFiles) (string, error)
- func EnsureRuntimeServiceIdentities(m Manifest, files RuntimeFiles) (map[string]string, error)
- func ExpectedPersistentRuntimeResources(m Manifest) []bhruntime.ProjectResource
- func ExpectedPostgresRuntimeResources(m Manifest) []bhruntime.ProjectResource
- func ExpectedRuntimeResources(m Manifest) []bhruntime.ProjectResource
- func ExternalOTLPEndpoint() string
- func FindRepositoryManifest(start string) (string, error)
- func GenerateSecretValue(generation SecretGeneration) ([]byte, error)
- func HasExplicitWorkload(m Manifest) bool
- func HasManagedRuntimeServices(m Manifest) bool
- func HasMetricsSources(m Manifest) bool
- func HasOTLPTelemetry(m Manifest) bool
- func HasObjectStorage(m Manifest) bool
- func HasRequiredFileSecrets(m Manifest) bool
- func HasRuntimeCapabilityPermission(m Manifest, capabilityID string) bool
- func HasRuntimeMetricsPermissions(m Manifest) bool
- func InspectOwnedRuntimeResources(ctx context.Context, compose bhruntime.Compose, m Manifest) ([]bhruntime.ProjectResource, error)
- func ManagedSecretsSecureBinding(m Manifest) capability.SecureBinding
- func MaterializeOTLPBinding(m Manifest, files RuntimeFiles, provider capability.ProviderKind, ...) error
- func MaterializeObjectStorageBinding(m Manifest, files RuntimeFiles, logicalBucket, physicalBucket, endpoint string) error
- func MaterializeRuntimeIdentityWorkloadOverride(m Manifest, workload WorkloadFiles, files RuntimeFiles, ...) (string, bool, error)
- func MetricsCollectionEnabled(m Manifest) (bool, error)
- func MetricsProviderNetworkName(m Manifest) string
- func MetricsRuntimeTargetVolumeName(m Manifest) string
- func MetricsTargetAlias(m Manifest, service string) string
- func MetricsTargetAliasFor(applicationName, environment, service string) string
- func ObjectStorageBucketNames(m Manifest) []string
- func ObjectStorageSecureBinding(m Manifest, bucket string) capability.SecureBinding
- func PostgresInstanceNames(m Manifest) []string
- func ProviderExternalReferenceEnv(provider capability.ProviderKind) string
- func ProviderPlacementNameToken(value string) string
- func ProviderScopeEnv(provider capability.ProviderKind) string
- func ProviderSharingBoundaryEnv(provider capability.ProviderKind) string
- func ReallocateRuntimePorts(m Manifest, files RuntimeFiles) error
- func ReconcileReferenceProviderRegistry(m Manifest) error
- func RedisInstanceNames(m Manifest) []string
- func RegisteredProviderPlacement(m Manifest, provider capability.ProviderKind) (capability.ProviderPlacement, bool, error)
- func ReleaseApplicationProviderRegistry(m Manifest) error
- func RemoveConnectivityRule(rule ConnectivityRule) error
- func RequiredSecretNames(m Manifest) []string
- func RequiredSecretUsesFileBinding(name string) bool
- func RequiresRuntimeBroker(m Manifest) bool
- func ResolveCapabilityResources(contract PortableContract) ([]capability.Resource, error)
- func ResolveProviderPlacement(_ Manifest, provider capability.ProviderKind) (capability.ProviderPlacement, error)
- func ResolveWorkloadCompose(repositoryRoot string, m Manifest) (string, bool, error)
- func ResourceExists(resources []bhruntime.ProjectResource, kind string) bool
- func ResourceNamedExists(resources []bhruntime.ProjectResource, wanted bhruntime.ProjectResource) bool
- func RestorePostgresInstances(ctx context.Context, runtime PostgresBackupRuntime, m Manifest, ...) error
- func RevokeRuntimeIdentity(m Manifest, files RuntimeFiles) error
- func RotateRuntimeIdentity(m Manifest, files RuntimeFiles) error
- func RuntimeAuthorizedServices(m Manifest) []string
- func RuntimeComposeYAML(m Manifest) (string, error)
- func RuntimeIdentityRevoked(files RuntimeFiles) bool
- func RuntimeIdentityRevokedPath(files RuntimeFiles) string
- func RuntimeIdentityTokenPath(files RuntimeFiles) string
- func RuntimeMTLSHostDir(files RuntimeFiles) string
- func RuntimePermissionFor(m Manifest, capabilityID, operation string) bool
- func RuntimeProjectName(m Manifest) string
- func RuntimeServiceIdentityDir(files RuntimeFiles) string
- func RuntimeServiceIdentityTokenPath(files RuntimeFiles, service string) string
- func SecretFileContainerPath(name string) string
- func SecretFileHostDir(files RuntimeFiles) string
- func SecretFileHostPath(files RuntimeFiles, name string) string
- func TelemetryProviderForDeployment() capability.Provider
- func ValidatePostgresBackupSet(m Manifest, backups []PostgresBackup) error
- func VerifyPostgresRuntime(ctx context.Context, compose bhruntime.Compose, m Manifest, files RuntimeFiles) error
- func VerifyValkeyRuntime(ctx context.Context, compose bhruntime.Compose, m Manifest, files RuntimeFiles) error
- func WorkloadProjectName(m Manifest) string
- type Action
- type BackupMetadata
- type CapabilityKind
- type CapabilityRequirement
- type ConnectivityEndpoint
- type ConnectivityRule
- type HTTPExposureRequirement
- type Manifest
- func LoadManifestFile(path string) (Manifest, error)
- func New(name, environment string, postgres, redis, secrets bool) Manifest
- func ParseYAML(input string) (Manifest, error)
- func WithGeneratedSecret(m Manifest, name, generationType string, size int) Manifest
- func WithHTTPExposure(m Manifest, name, service string, port int, protocol string) Manifest
- func WithMetricsSource(m Manifest, name, service string, port int, path string) Manifest
- func WithOTLPTelemetry(m Manifest, signals ...string) Manifest
- func WithObjectStorageBuckets(m Manifest, names ...string) Manifest
- func WithPostgresInstances(m Manifest, names ...string) Manifest
- func WithRedisInstances(m Manifest, names ...string) Manifest
- func WithRequiredSecrets(m Manifest, names ...string) Manifest
- func WithRuntimePermission(m Manifest, capabilityID string, services []string, operations ...string) Manifest
- func WithWorkload(m Manifest, compose string, services ...string) Manifest
- type MetricsDeploymentPolicy
- type MetricsRequirements
- type MetricsSourceClass
- type MetricsSourceRequirement
- type OTLPRequirement
- type ObjectStorageCredentials
- type Plan
- type PortableContract
- type PostgresBackup
- type PostgresBackupRuntime
- type RecoveryMetadata
- type RuntimeContract
- type RuntimeFiles
- type RuntimePermission
- type RuntimeRequirements
- type SecretContract
- type SecretGeneration
- type SecretRequirement
- type SecretRequirements
- type ServiceBinding
- type ServiceInstance
- type Services
- type Store
- func (s Store) Create(m Manifest) (string, error)
- func (s Store) Delete(name string) error
- func (s Store) LastBackup(applicationName string) (BackupMetadata, error)
- func (s Store) LastRecovery(applicationName string) (RecoveryMetadata, error)
- func (s Store) LastUpdate(applicationName string) (UpdateMetadata, error)
- func (s Store) List() ([]Manifest, error)
- func (s Store) Load(name string) (Manifest, string, error)
- func (s Store) RecordLastBackup(metadata BackupMetadata) error
- func (s Store) RecordLastRecovery(metadata RecoveryMetadata) error
- func (s Store) RecordLastUpdate(metadata UpdateMetadata) error
- func (s Store) Sync(m Manifest) (string, error)
- type TelemetryRequirements
- type UpdateMetadata
- type WorkloadBindingPlan
- type WorkloadConfig
- type WorkloadFiles
Constants ¶
const ( MetricsEnabledEnv = "BASEHARBOR_METRICS_ENABLED" MetricsCollectSourcesEnv = "BASEHARBOR_METRICS_COLLECT" )
const ( DefaultRuntimeAPIURL = "https://baseharbor-runtime:8443" RuntimeIdentityContainerTokenPath = "/run/secrets/baseharbor-runtime-token" RuntimeIdentityContainerCAPath = "/run/secrets/baseharbor-runtime-ca" RuntimeIdentityContainerClientCertPath = "/run/secrets/baseharbor-runtime-client-cert" RuntimeIdentityContainerClientKeyPath = "/run/secrets/baseharbor-runtime-client-key" SecretFileBindingContainerDir = "/run/baseharbor/bindings/secrets" )
const ( OTLPProviderEnv = "BASEHARBOR_OTLP_PROVIDER" OTLPEndpointEnv = "BASEHARBOR_OTLP_ENDPOINT" )
const CurrentVersion = 1
const (
LastBackupMetadataVersion = 1
)
const (
LastRecoveryMetadataVersion = 1
)
const (
LastUpdateMetadataVersion = 1
)
const MaxPostgresBackupBytes int64 = 512 << 20
const RepositoryManifestName = "baseharbor.yaml"
Variables ¶
var ErrExists = errors.New("application already exists")
var ErrNoBackupMetadata = errors.New("no application backup metadata recorded")
var ErrNoRecoveryMetadata = errors.New("no application recovery metadata recorded")
var ErrNoUpdateMetadata = errors.New("no application update metadata recorded")
var ErrRuntimeAPIURL = errors.New("application runtime API URL is invalid")
var ErrRuntimeDefinitionChanged = errors.New("application runtime definition differs from the BaseHarbor-managed definition")
var ErrRuntimeNotApplied = errors.New("application runtime has not been applied")
var ErrUnsupportedService = errors.New("application contains services that are not yet supported by apply")
var ErrWorkloadComposeAmbiguous = errors.New("multiple application Compose files found")
var ErrWorkloadComposeNotFound = errors.New("application Compose file not found")
Functions ¶
func AddConnectivityRule ¶ added in v0.4.8
func AddConnectivityRule(rule ConnectivityRule) error
func ApplicationBackendNetworkName ¶
ApplicationBackendNetworkName returns the stable Docker/Podman network name used by BaseHarbor-managed backend services for one application environment.
Application-owned workloads may attach to this network as an additional external network without replacing their own Compose networks. The current Compose provider maps the logical backend network to the deterministic project default network.
func ApplicationExposureNetworkName ¶ added in v0.4.4
ApplicationExposureNetworkName returns the stable Compose network used to connect explicitly exposed workload endpoints to the selected exposure provider. It is separate from the managed backend network because endpoint exposure must also work for workload-only applications.
func CapabilityBindings ¶ added in v0.4.1
func CapabilityBindings(m Manifest) ([]capability.Binding, error)
func CheckApplicationConnectivityReleased ¶ added in v0.4.8
func CheckControlPlaneDestroySafe ¶ added in v0.4.4
func CheckControlPlaneDestroySafe() error
func CheckManagedRuntimeDefinition ¶
func CheckManagedRuntimeDefinition(files RuntimeFiles, m Manifest) error
CheckManagedRuntimeDefinition prevents destructive operations from trusting a locally modified Compose file. BaseHarbor may only mutate the runtime shape it originally generated and understands for the current manifest.
func CheckReferenceProviderRegistry ¶ added in v0.4.4
CheckReferenceProviderRegistry validates the protected provider registry and simulates the desired application reconciliation without writing it. Lifecycle callers use this during preflight so invalid provider metadata fails before any runtime or workload mutation.
func CheckRuntimePermissions ¶
func CheckRuntimePermissions(files RuntimeFiles) error
func ConfiguredRuntimeAPIURL ¶
func ConnectivityNetworkName ¶ added in v0.4.8
func ConnectivityNetworkName(rule ConnectivityRule) string
func ConnectivityRuleID ¶ added in v0.4.8
func ConnectivityRuleID(rule ConnectivityRule) string
func ConnectivityTargetAlias ¶ added in v0.4.8
func ConnectivityTargetAlias(rule ConnectivityRule) string
func DefaultProviderPlacement ¶ added in v0.4.8
func DefaultProviderPlacement(provider capability.ProviderKind) (capability.ProviderPlacement, error)
func EnsureRuntimeIdentity ¶
func EnsureRuntimeIdentity(m Manifest, files RuntimeFiles) (string, error)
func EnsureRuntimeServiceIdentities ¶ added in v0.4.8
func EnsureRuntimeServiceIdentities(m Manifest, files RuntimeFiles) (map[string]string, error)
func ExpectedPersistentRuntimeResources ¶
func ExpectedPersistentRuntimeResources(m Manifest) []bhruntime.ProjectResource
func ExpectedPostgresRuntimeResources ¶
func ExpectedPostgresRuntimeResources(m Manifest) []bhruntime.ProjectResource
ExpectedPostgresRuntimeResources is kept for compatibility with the first runtime milestone. New lifecycle code should use ExpectedRuntimeResources.
func ExpectedRuntimeResources ¶
func ExpectedRuntimeResources(m Manifest) []bhruntime.ProjectResource
func ExternalOTLPEndpoint ¶ added in v0.4.7
func ExternalOTLPEndpoint() string
func FindRepositoryManifest ¶
FindRepositoryManifest returns the nearest baseharbor.yaml from start upward. This lets developers run baha from nested directories inside an application repository.
func GenerateSecretValue ¶
func GenerateSecretValue(generation SecretGeneration) ([]byte, error)
func HasExplicitWorkload ¶ added in v0.3.0
HasExplicitWorkload reports whether the repository manifest explicitly declares a Compose workload. Workload-only applications must be explicit so validation never guesses based on files outside the manifest.
func HasManagedRuntimeServices ¶ added in v0.3.0
HasManagedRuntimeServices reports whether BaseHarbor owns a materialized PostgreSQL or Valkey runtime for the application. Shared object storage uses its own lazy provider runtime and is intentionally not part of this project.
func HasMetricsSources ¶ added in v0.4.8
func HasOTLPTelemetry ¶ added in v0.4.7
func HasObjectStorage ¶ added in v0.4.6
HasObjectStorage reports whether the application explicitly requests at least one logical S3 bucket.
func HasRequiredFileSecrets ¶
func HasRuntimeCapabilityPermission ¶ added in v0.4.8
func HasRuntimeMetricsPermissions ¶ added in v0.4.8
func ManagedSecretsSecureBinding ¶ added in v0.4.5
func ManagedSecretsSecureBinding(m Manifest) capability.SecureBinding
ManagedSecretsSecureBinding describes the existing BaseHarbor runtime identity/secret-delivery semantics without exposing OpenBao paths, AppRoles, policies, tokens, private keys, or provider-specific object names.
func MaterializeOTLPBinding ¶ added in v0.4.7
func MaterializeOTLPBinding(m Manifest, files RuntimeFiles, provider capability.ProviderKind, hostEndpoint, containerEndpoint string) error
func MaterializeObjectStorageBinding ¶ added in v0.4.6
func MaterializeObjectStorageBinding(m Manifest, files RuntimeFiles, logicalBucket, physicalBucket, endpoint string) error
MaterializeObjectStorageBinding updates the standard application-facing environment/file binding after the selected provider has materialized its concrete endpoint and bucket identity.
func MaterializeRuntimeIdentityWorkloadOverride ¶
func MaterializeRuntimeIdentityWorkloadOverride(m Manifest, workload WorkloadFiles, files RuntimeFiles, plan WorkloadBindingPlan) (string, bool, error)
MaterializeRuntimeIdentityWorkloadOverride adds only the protected bindings that selected application services actually consume. Runtime identity is injected through ordinary environment file paths plus Compose secret mounts; applications do not configure certificates, keys or broker topology.
func MetricsCollectionEnabled ¶ added in v0.4.8
MetricsCollectionEnabled is deployment policy, not portable application intent. Local development enables collection by default; test/staging/production require an explicit operator opt-in unless overridden with BASEHARBOR_METRICS_ENABLED.
func MetricsProviderNetworkName ¶ added in v0.4.8
func MetricsRuntimeTargetVolumeName ¶ added in v0.4.8
func MetricsTargetAlias ¶ added in v0.4.8
func MetricsTargetAliasFor ¶ added in v0.4.8
func ObjectStorageBucketNames ¶ added in v0.4.6
func ObjectStorageSecureBinding ¶ added in v0.4.6
func ObjectStorageSecureBinding(m Manifest, bucket string) capability.SecureBinding
ObjectStorageSecureBinding describes one application-owned S3 bucket without exposing concrete credentials or provider-specific identity/policy objects.
func PostgresInstanceNames ¶
func ProviderExternalReferenceEnv ¶ added in v0.4.8
func ProviderExternalReferenceEnv(provider capability.ProviderKind) string
func ProviderPlacementNameToken ¶ added in v0.4.8
func ProviderScopeEnv ¶ added in v0.4.8
func ProviderScopeEnv(provider capability.ProviderKind) string
func ProviderSharingBoundaryEnv ¶ added in v0.4.8
func ProviderSharingBoundaryEnv(provider capability.ProviderKind) string
func ReallocateRuntimePorts ¶
func ReallocateRuntimePorts(m Manifest, files RuntimeFiles) error
ReallocateRuntimePorts replaces only the generated host-port assignments for an already materialized application runtime. Credentials, databases, volumes and other persisted runtime values are left unchanged. This is used when the container runtime proves that a probed loopback port was claimed between allocation and the actual container bind.
func ReconcileReferenceProviderRegistry ¶ added in v0.4.2
func RedisInstanceNames ¶
func RegisteredProviderPlacement ¶ added in v0.4.8
func RegisteredProviderPlacement(m Manifest, provider capability.ProviderKind) (capability.ProviderPlacement, bool, error)
func ReleaseApplicationProviderRegistry ¶ added in v0.4.2
func RemoveConnectivityRule ¶ added in v0.4.8
func RemoveConnectivityRule(rule ConnectivityRule) error
func RequiredSecretNames ¶
func RequiresRuntimeBroker ¶ added in v0.4.8
RequiresRuntimeBroker reports whether the application currently needs the per-application Application Runtime Broker. Keep broker lifecycle decisions centralized here so new authorized runtime capabilities can extend the requirement without duplicating lifecycle conditionals throughout the CLI.
func ResolveCapabilityResources ¶ added in v0.4.1
func ResolveCapabilityResources(contract PortableContract) ([]capability.Resource, error)
func ResolveProviderPlacement ¶ added in v0.4.8
func ResolveProviderPlacement(_ Manifest, provider capability.ProviderKind) (capability.ProviderPlacement, error)
ResolveProviderPlacement resolves deployment/operator placement for a provider. Portable application intent never participates in this decision. Defaults are deliberately simple; advanced users can override supported placement fields through the generic provider policy namespace.
func ResolveWorkloadCompose ¶
func ResourceExists ¶
func ResourceExists(resources []bhruntime.ProjectResource, kind string) bool
func ResourceNamedExists ¶
func ResourceNamedExists(resources []bhruntime.ProjectResource, wanted bhruntime.ProjectResource) bool
func RestorePostgresInstances ¶
func RestorePostgresInstances(ctx context.Context, runtime PostgresBackupRuntime, m Manifest, files RuntimeFiles, backups []PostgresBackup) error
func RevokeRuntimeIdentity ¶
func RevokeRuntimeIdentity(m Manifest, files RuntimeFiles) error
func RotateRuntimeIdentity ¶
func RotateRuntimeIdentity(m Manifest, files RuntimeFiles) error
func RuntimeAuthorizedServices ¶ added in v0.4.8
func RuntimeComposeYAML ¶
func RuntimeIdentityRevoked ¶
func RuntimeIdentityRevoked(files RuntimeFiles) bool
func RuntimeIdentityRevokedPath ¶
func RuntimeIdentityRevokedPath(files RuntimeFiles) string
func RuntimeIdentityTokenPath ¶
func RuntimeIdentityTokenPath(files RuntimeFiles) string
func RuntimeMTLSHostDir ¶
func RuntimeMTLSHostDir(files RuntimeFiles) string
func RuntimePermissionFor ¶ added in v0.4.8
func RuntimeProjectName ¶
func RuntimeServiceIdentityDir ¶ added in v0.4.8
func RuntimeServiceIdentityDir(files RuntimeFiles) string
func RuntimeServiceIdentityTokenPath ¶ added in v0.4.8
func RuntimeServiceIdentityTokenPath(files RuntimeFiles, service string) string
func SecretFileContainerPath ¶
func SecretFileHostDir ¶
func SecretFileHostDir(files RuntimeFiles) string
func SecretFileHostPath ¶
func SecretFileHostPath(files RuntimeFiles, name string) string
func TelemetryProviderForDeployment ¶ added in v0.4.7
func TelemetryProviderForDeployment() capability.Provider
func ValidatePostgresBackupSet ¶
func ValidatePostgresBackupSet(m Manifest, backups []PostgresBackup) error
func VerifyPostgresRuntime ¶
func VerifyValkeyRuntime ¶
func WorkloadProjectName ¶
Types ¶
type BackupMetadata ¶ added in v0.3.0
type BackupMetadata struct {
Version int `json:"version"`
Application string `json:"application"`
Environment string `json:"environment"`
CreatedAt time.Time `json:"created_at"`
ArchivePath string `json:"archive_path"`
PostgresResources []string `json:"postgres_resources,omitempty"`
IncludesSecrets bool `json:"includes_secrets"`
}
func (BackupMetadata) Validate ¶ added in v0.3.0
func (m BackupMetadata) Validate() error
type CapabilityKind ¶ added in v0.4.0
type CapabilityKind = capability.Kind
CapabilityKind and CapabilityRequirement remain aliases in the application package so existing v0.4 callers keep their source-compatible contract while the reusable capability domain moves into the shared core.
const ( CapabilitySQL CapabilityKind = capability.SQL CapabilityKeyValue CapabilityKind = capability.KeyValue CapabilityExposureHTTP CapabilityKind = capability.ExposureHTTP CapabilityObjectStorageS3 CapabilityKind = capability.ObjectStorageS3 CapabilityTelemetryOTLP CapabilityKind = capability.TelemetryOTLP CapabilityMetrics CapabilityKind = capability.Metrics )
type CapabilityRequirement ¶ added in v0.4.0
type CapabilityRequirement = capability.Requirement
type ConnectivityEndpoint ¶ added in v0.4.8
type ConnectivityEndpoint struct {
Application string `json:"application"`
Environment string `json:"environment"`
Service string `json:"service"`
Port int `json:"port,omitempty"`
}
func (ConnectivityEndpoint) Validate ¶ added in v0.4.8
func (e ConnectivityEndpoint) Validate() error
type ConnectivityRule ¶ added in v0.4.8
type ConnectivityRule struct {
Source ConnectivityEndpoint `json:"source"`
Target ConnectivityEndpoint `json:"target"`
}
func LoadConnectivityRules ¶ added in v0.4.8
func LoadConnectivityRules() ([]ConnectivityRule, error)
func (ConnectivityRule) Validate ¶ added in v0.4.8
func (r ConnectivityRule) Validate() error
type HTTPExposureRequirement ¶ added in v0.4.4
type HTTPExposureRequirement struct {
Name string
Service string
Port int
Protocol string
Visibility string
}
HTTPExposureRequirement is provider-neutral public HTTP exposure intent. Hostname, host port, TLS source paths and reverse-proxy implementation are deployment/provider state and deliberately absent.
type Manifest ¶
type Manifest struct {
Version int
Name string
Environment string
Services Services
Secrets SecretRequirements
Workload WorkloadConfig
Exposures []HTTPExposureRequirement
Telemetry TelemetryRequirements
Metrics MetricsRequirements
Runtime RuntimeRequirements
}
Manifest is the declarative application backend request understood by BaseHarbor.
func LoadManifestFile ¶
func ParseYAML ¶
ParseYAML parses the intentionally small v1 manifest grammar without adding a runtime dependency.
func WithGeneratedSecret ¶
func WithHTTPExposure ¶ added in v0.4.4
func WithMetricsSource ¶ added in v0.4.8
func WithOTLPTelemetry ¶ added in v0.4.7
func WithObjectStorageBuckets ¶ added in v0.4.6
func WithPostgresInstances ¶
func WithRedisInstances ¶
func WithRequiredSecrets ¶
func WithRuntimePermission ¶ added in v0.4.8
type MetricsDeploymentPolicy ¶ added in v0.4.8
type MetricsDeploymentPolicy struct {
Enabled bool
Collect map[MetricsSourceClass]bool
}
func MetricsPolicy ¶ added in v0.4.8
func MetricsPolicy(m Manifest) (MetricsDeploymentPolicy, error)
MetricsPolicy is deployment/operator state, never portable application intent. Defaults deliberately grant the minimum useful collection surface: application metrics only. Broader provider/platform collection is explicit.
type MetricsRequirements ¶ added in v0.4.8
type MetricsRequirements struct {
Sources []MetricsSourceRequirement
}
type MetricsSourceClass ¶ added in v0.4.8
type MetricsSourceClass string
const ( MetricsSourceApplication MetricsSourceClass = "application" MetricsSourceApplicationProvider MetricsSourceClass = "application-provider" MetricsSourcePlatformProvider MetricsSourceClass = "platform-provider" )
type MetricsSourceRequirement ¶ added in v0.4.8
type OTLPRequirement ¶ added in v0.4.7
type OTLPRequirement struct {
Signals []string
}
type ObjectStorageCredentials ¶ added in v0.4.6
func LoadObjectStorageCredentials ¶ added in v0.4.6
func LoadObjectStorageCredentials(files RuntimeFiles, bucket string) (ObjectStorageCredentials, error)
type PortableContract ¶ added in v0.4.0
type PortableContract struct {
Application string
Capabilities []CapabilityRequirement
Secrets SecretContract
Exposures []HTTPExposureRequirement
Metrics []MetricsSourceRequirement
}
PortableContract is the provider-neutral application requirement view used as the seam between manifest compatibility and runtime/capability providers.
Deployment context such as environment, Compose paths, host ports, TLS source directories and provider object names must not be added here. Those belong to deployment state or provider-specific configuration.
func PortableContractFromManifest ¶ added in v0.4.0
func PortableContractFromManifest(m Manifest) (PortableContract, error)
PortableContractFromManifest translates the current manifest v1 compatibility surface into provider-neutral requirements without changing manifest behavior.
type PostgresBackup ¶
func DumpPostgresInstances ¶
func DumpPostgresInstances(ctx context.Context, runtime PostgresBackupRuntime, m Manifest, files RuntimeFiles) ([]PostgresBackup, error)
type PostgresBackupRuntime ¶
type RecoveryMetadata ¶ added in v0.3.0
type RecoveryMetadata struct {
Version int `json:"version"`
Application string `json:"application"`
Environment string `json:"environment"`
RestoredAt time.Time `json:"restored_at"`
BackupCreatedAt time.Time `json:"backup_created_at"`
ArchivePath string `json:"archive_path"`
}
func (RecoveryMetadata) Validate ¶ added in v0.3.0
func (m RecoveryMetadata) Validate() error
type RuntimeContract ¶
func EnsureRuntimeContract ¶
func EnsureRuntimeContract(m Manifest, files RuntimeFiles) (RuntimeContract, error)
type RuntimeFiles ¶
type RuntimeFiles struct {
Dir string
Compose string
Env string
ApplicationEnv string
Bindings string
}
func EnsurePostgresRuntime ¶
func EnsurePostgresRuntime(store Store, m Manifest) (RuntimeFiles, error)
EnsurePostgresRuntime is kept for callers from the first runtime milestone.
func EnsureRuntime ¶
func EnsureRuntime(store Store, m Manifest) (RuntimeFiles, error)
func ExistingRuntimeFiles ¶
func ExistingRuntimeFiles(store Store, m Manifest) (RuntimeFiles, error)
func RuntimeFilesFor ¶ added in v0.4.4
func RuntimeFilesFor(store Store, m Manifest) RuntimeFiles
type RuntimePermission ¶ added in v0.4.8
type RuntimeRequirements ¶ added in v0.4.8
type RuntimeRequirements struct {
Permissions []RuntimePermission
}
type SecretContract ¶ added in v0.4.0
type SecretContract struct {
Managed bool
Required []SecretRequirement
}
SecretContract describes secret intent without selecting a concrete secret backend or delivery mechanism. Required values remain names/generation intent only; provider credentials and provider object identifiers never belong here.
type SecretGeneration ¶
type SecretRequirement ¶
type SecretRequirement struct {
Name string
Generate *SecretGeneration
}
func GeneratedSecretRequirements ¶
func GeneratedSecretRequirements(m Manifest) []SecretRequirement
func SecretRequirementByName ¶
func SecretRequirementByName(m Manifest, name string) (SecretRequirement, bool)
type SecretRequirements ¶
type SecretRequirements struct {
Required []SecretRequirement
}
SecretRequirements declares application-owned secret requirements. Values never belong in the manifest. Generate only expresses explicit intent for BaseHarbor to create a missing value directly in the managed secret backend.
type ServiceBinding ¶ added in v0.3.0
type ServiceBinding struct {
Kind string
Instance string
Host string
Port string
Database string
Username string
Password string
URI string
}
ServiceBinding is the provider-neutral information needed by developer access actions. Callers should prefer these fields over runtime/container names so a later provider can satisfy the same action model.
func ResolveServiceBinding ¶ added in v0.3.0
func ResolveServiceBinding(files RuntimeFiles, kind, instance string) (ServiceBinding, error)
ResolveServiceBinding loads an already-materialized owner-only service binding. It never creates or rotates credentials.
type ServiceInstance ¶
type ServiceInstance struct{}
ServiceInstance is the stable logical identity of one requested backend service. The empty v1 shape is intentional: topology remains a BaseHarbor implementation detail and future intent such as availability can evolve here.
type Services ¶
type Services struct {
Postgres bool
Redis bool
Secrets bool
ObjectStorage bool
PostgresInstances map[string]ServiceInstance
RedisInstances map[string]ServiceInstance
ObjectStorageBuckets map[string]ServiceInstance
}
type Store ¶
type Store struct {
Root string
}
func DefaultStore ¶
func DefaultStore() Store
func (Store) LastBackup ¶ added in v0.3.0
func (s Store) LastBackup(applicationName string) (BackupMetadata, error)
func (Store) LastRecovery ¶ added in v0.3.0
func (s Store) LastRecovery(applicationName string) (RecoveryMetadata, error)
func (Store) LastUpdate ¶ added in v0.3.0
func (s Store) LastUpdate(applicationName string) (UpdateMetadata, error)
func (Store) RecordLastBackup ¶ added in v0.3.0
func (s Store) RecordLastBackup(metadata BackupMetadata) error
func (Store) RecordLastRecovery ¶ added in v0.3.0
func (s Store) RecordLastRecovery(metadata RecoveryMetadata) error
func (Store) RecordLastUpdate ¶ added in v0.3.0
func (s Store) RecordLastUpdate(metadata UpdateMetadata) error
type TelemetryRequirements ¶ added in v0.4.7
type TelemetryRequirements struct {
OTLP *OTLPRequirement
}
type UpdateMetadata ¶ added in v0.3.0
type UpdateMetadata struct {
Version int `json:"version"`
Application string `json:"application"`
Environment string `json:"environment"`
UpdatedAt time.Time `json:"updated_at"`
Branch string `json:"branch"`
Upstream string `json:"upstream"`
FromRevision string `json:"from_revision"`
ToRevision string `json:"to_revision"`
Result string `json:"result"`
BackupPath string `json:"backup_path,omitempty"`
BackupCreatedAt time.Time `json:"backup_created_at,omitempty"`
}
func (UpdateMetadata) Validate ¶ added in v0.3.0
func (m UpdateMetadata) Validate() error
type WorkloadBindingPlan ¶
type WorkloadBindingPlan struct {
RuntimeIdentityServices []string
FileSecretsByService map[string][]string
}
func (WorkloadBindingPlan) Empty ¶
func (p WorkloadBindingPlan) Empty() bool
type WorkloadConfig ¶
WorkloadConfig optionally disambiguates an existing application Compose workload. Empty values keep the common case convention-based: BaseHarbor may detect one unambiguous Compose file and attach all of its services.
type WorkloadFiles ¶
type WorkloadFiles struct {
RepositoryRoot string
Compose string
Override string
Services []string
Project string
Partial bool
}
func MaterializeWorkload ¶
func MaterializeWorkload(repositoryRoot string, m Manifest, runtime RuntimeFiles) (WorkloadFiles, bool, error)
Source Files
¶
- access.go
- backup_metadata.go
- capability_model.go
- connectivity.go
- contract.go
- generated_secrets.go
- manifest.go
- metrics_policy.go
- network.go
- object_storage_binding.go
- object_storage_runtime.go
- plan.go
- postgres_backup.go
- provider_placement.go
- provider_registry.go
- recovery_metadata.go
- repository_manifest.go
- runtime_contract.go
- runtime_identity.go
- runtime_identity_workload.go
- runtime_inspect.go
- runtime_lifecycle.go
- runtime_ports.go
- runtime_postgres.go
- runtime_shape.go
- secure_binding.go
- store.go
- telemetry_binding.go
- update_metadata.go
- workload.go