Documentation
¶
Index ¶
- Constants
- Variables
- type Binding
- type Diagnostic
- type Driver
- type Kind
- type LifecycleAction
- type LifecycleOperation
- type Phase
- type Plan
- type PlanItem
- type Provider
- type ProviderBinding
- type ProviderInstance
- type ProviderKind
- type ProviderOwnership
- type ProviderScope
- type Registry
- func (r Registry) ApplicationLifecycle(application string, operation LifecycleOperation) ([]LifecycleAction, error)
- func (r *Registry) Bind(resource Resource, providerInstanceID string) error
- func (r *Registry) Register(instance ProviderInstance) error
- func (r *Registry) ReleaseApplication(application string)
- func (r *Registry) ReleaseManagedApplication(application string)
- func (r Registry) Resolve(provider ProviderKind, scope ProviderScope, application, externalID string) (ProviderInstance, error)
- func (r Registry) Validate() error
- type RegistryStore
- type Request
- type Requirement
- type Resource
- type Result
- type Severity
- type Status
- type StepResult
Constants ¶
const RegistryVersion = 1
Variables ¶
var ( PostgreSQL = Provider{ Kind: ProviderPostgreSQL, Capabilities: []Kind{SQL}, } Valkey = Provider{ Kind: ProviderValkey, Capabilities: []Kind{KeyValue}, } OpenBao = Provider{ Kind: ProviderOpenBao, Capabilities: []Kind{Secrets}, } )
Reference providers describe the capability products already used by the current Compose implementation. They are descriptors only: existing provisioning remains authoritative while the shared capability and provider registry layers describe portable intent, placement and ownership.
Functions ¶
This section is empty.
Types ¶
type Diagnostic ¶
type Kind ¶
type Kind string
Kind identifies portable application behavior. It describes what an application needs, never which product or runtime satisfies that need.
type LifecycleAction ¶ added in v0.4.2
type LifecycleAction struct {
ProviderInstanceID string `json:"provider_instance_id"`
Scope ProviderScope `json:"scope"`
Ownership ProviderOwnership `json:"ownership"`
Operation LifecycleOperation `json:"operation"`
MutateProvider bool `json:"mutate_provider"`
RemoveBinding bool `json:"remove_binding"`
}
type LifecycleOperation ¶ added in v0.4.2
type LifecycleOperation string
const ( LifecycleUpdate LifecycleOperation = "update" LifecycleBackup LifecycleOperation = "backup" LifecycleDestroy LifecycleOperation = "destroy" )
type Provider ¶
type Provider struct {
Kind ProviderKind `json:"kind"`
Capabilities []Kind `json:"capabilities"`
}
Provider describes the capability surface of one provider implementation. Placement and ownership stay outside portable capability intent and are represented separately by the provider registry.
type ProviderBinding ¶ added in v0.4.2
type ProviderInstance ¶ added in v0.4.2
type ProviderInstance struct {
ID string `json:"id"`
Provider Provider `json:"provider"`
Scope ProviderScope `json:"scope"`
Ownership ProviderOwnership `json:"ownership"`
OwnerApplication string `json:"owner_application,omitempty"`
Reference string `json:"reference,omitempty"`
}
type ProviderKind ¶
type ProviderKind string
ProviderKind identifies a capability implementation. Capability providers are independent from runtime providers such as Compose.
const ( ProviderPostgreSQL ProviderKind = "postgresql" ProviderValkey ProviderKind = "valkey" ProviderOpenBao ProviderKind = "openbao" )
type ProviderOwnership ¶ added in v0.4.2
type ProviderOwnership string
const ( OwnershipBaseHarbor ProviderOwnership = "baseharbor" OwnershipExternal ProviderOwnership = "external" )
type ProviderScope ¶ added in v0.4.2
type ProviderScope string
const ( ScopeApplication ProviderScope = "application" ScopeExternal ProviderScope = "external" )
type Registry ¶ added in v0.4.2
type Registry struct {
Version int `json:"version"`
Instances []ProviderInstance `json:"instances,omitempty"`
Bindings []ProviderBinding `json:"bindings,omitempty"`
}
func NewRegistry ¶ added in v0.4.2
func NewRegistry() Registry
func (Registry) ApplicationLifecycle ¶ added in v0.4.2
func (r Registry) ApplicationLifecycle(application string, operation LifecycleOperation) ([]LifecycleAction, error)
func (*Registry) Register ¶ added in v0.4.2
func (r *Registry) Register(instance ProviderInstance) error
func (*Registry) ReleaseApplication ¶ added in v0.4.2
func (*Registry) ReleaseManagedApplication ¶ added in v0.4.2
func (Registry) Resolve ¶ added in v0.4.2
func (r Registry) Resolve(provider ProviderKind, scope ProviderScope, application, externalID string) (ProviderInstance, error)
type RegistryStore ¶ added in v0.4.2
type RegistryStore struct{ Path string }
func (RegistryStore) Load ¶ added in v0.4.2
func (s RegistryStore) Load() (Registry, error)
func (RegistryStore) Save ¶ added in v0.4.2
func (s RegistryStore) Save(registry Registry) error
type Request ¶
type Request struct {
Requirement Requirement
Workload string
Driver Driver
}
type Requirement ¶
Requirement is one application-owned logical capability request.
type Resource ¶
type Resource struct {
Application string `json:"application"`
Kind Kind `json:"kind"`
Name string `json:"name"`
Provider ProviderKind `json:"provider"`
}
Resource is the provider-backed representation of one stable logical application resource. Provider-specific object names, ports and credentials are intentionally absent.
type Result ¶
type Result struct {
Application string `json:"application"`
Status Status `json:"status"`
Plan Plan `json:"plan"`
Steps []StepResult `json:"steps"`
}
type StepResult ¶
type StepResult struct {
Phase Phase `json:"phase"`
Status Status `json:"status"`
Resource Resource `json:"resource"`
Binding Binding `json:"binding"`
Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
}