Documentation
¶
Index ¶
- func MarshalJSONResult(result Result) ([]byte, error)
- func ParsePublishedPort(value string) (int, bool)
- func Reconcile(findings []Finding, manifest *application.Manifest) ([]CapabilityIntent, []ReconciliationItem)
- type Artifact
- type CapabilityIntent
- type ComposeAnalysis
- type Confidence
- type Detector
- type Direction
- type Engine
- type Evidence
- type EvidenceKind
- type Finding
- type PortEvidence
- type ReclaimableComposeVolume
- type ReconciliationItem
- type ReconciliationState
- type Result
- type RuntimeOperation
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalJSONResult ¶
func ParsePublishedPort ¶
ParsePublishedPort extracts the host-side numeric port from common Compose short syntax. It is intentionally conservative and returns false on ambiguity.
func Reconcile ¶ added in v0.4.8
func Reconcile(findings []Finding, manifest *application.Manifest) ([]CapabilityIntent, []ReconciliationItem)
Reconcile compares read-only repository evidence with the explicit application contract. It never mutates the manifest. In particular, "stale" means only that current inspection did not rediscover evidence; it is never permission to remove a declared capability.
Types ¶
type CapabilityIntent ¶ added in v0.4.8
type ComposeAnalysis ¶
type ComposeAnalysis struct {
WorkloadServices []string `json:"workload_services,omitempty"`
InfrastructureServices []string `json:"infrastructure_services,omitempty"`
AmbiguousServices []string `json:"ambiguous_services,omitempty"`
SQLInstances []string `json:"sql_instances,omitempty"`
CacheInstances []string `json:"cache_instances,omitempty"`
ObjectStorageServices []string `json:"object_storage_services,omitempty"`
Ports []PortEvidence `json:"ports,omitempty"`
HealthChecks []Evidence `json:"health_checks,omitempty"`
DatabaseBootstrapServices []string `json:"database_bootstrap_services,omitempty"`
}
func AnalyzeComposeFile ¶
func AnalyzeComposeFile(root, rel string) (ComposeAnalysis, error)
type Confidence ¶
type Confidence string
const ( ConfidenceDetected Confidence = "detected" ConfidenceSuggested Confidence = "suggested" ConfidencePossible Confidence = "possible" )
type Engine ¶
type Engine struct {
Detectors []Detector
}
func DefaultEngine ¶
func DefaultEngine() Engine
type Evidence ¶
type Evidence struct {
Kind EvidenceKind `json:"kind"`
Path string `json:"path"`
Detail string `json:"detail"`
}
type EvidenceKind ¶
type EvidenceKind string
const ( EvidenceManifest EvidenceKind = "manifest" EvidenceCompose EvidenceKind = "compose" EvidenceDependency EvidenceKind = "dependency" EvidenceEnv EvidenceKind = "env" EvidenceImport EvidenceKind = "import" EvidencePort EvidenceKind = "port" EvidenceHealth EvidenceKind = "healthcheck" EvidenceConfig EvidenceKind = "config" EvidenceEndpoint EvidenceKind = "endpoint" EvidenceCall EvidenceKind = "call" )
type Finding ¶
type Finding struct {
Service string `json:"service,omitempty"`
Protocol string `json:"protocol,omitempty"`
Capability string `json:"capability"`
Name string `json:"name,omitempty"`
Direction Direction `json:"direction,omitempty"`
Operations []RuntimeOperation `json:"operations,omitempty"`
Confidence Confidence `json:"confidence"`
Evidence []Evidence `json:"evidence"`
}
type PortEvidence ¶
type ReclaimableComposeVolume ¶ added in v0.4.16
func ReclaimableReplacedInfrastructureVolumes ¶ added in v0.4.16
func ReclaimableReplacedInfrastructureVolumes(rendered []byte, selected []string, managedSQL, managedCache bool) ([]ReclaimableComposeVolume, error)
ReclaimableReplacedInfrastructureVolumes returns only named volumes whose rendered Compose ownership can be attributed exclusively to repository PostgreSQL/Redis services that BaseHarbor replaced with managed capabilities. Volumes shared with selected workload services, external volumes and unrecognized infrastructure are intentionally excluded.
type ReconciliationItem ¶ added in v0.4.8
type ReconciliationItem struct {
Capability string `json:"capability"`
Name string `json:"name,omitempty"`
Direction Direction `json:"direction,omitempty"`
State ReconciliationState `json:"state"`
Operations []RuntimeOperation `json:"operations,omitempty"`
Confidence Confidence `json:"confidence,omitempty"`
Evidence []Evidence `json:"evidence,omitempty"`
}
type ReconciliationState ¶ added in v0.4.8
type ReconciliationState string
const ( ReconciliationSatisfied ReconciliationState = "satisfied" ReconciliationNew ReconciliationState = "new" ReconciliationStale ReconciliationState = "stale" ReconciliationAmbiguous ReconciliationState = "ambiguous" )
type Result ¶
type Result struct {
ContractVersion string `json:"contract_version"`
Root string `json:"root"`
Application string `json:"application"`
ExistingManifest string `json:"existing_manifest,omitempty"`
Artifacts []Artifact `json:"artifacts,omitempty"`
ComposeCandidates []string `json:"compose_candidates,omitempty"`
SelectedCompose string `json:"selected_compose,omitempty"`
WorkloadServices []string `json:"workload_services,omitempty"`
InfrastructureServices []string `json:"infrastructure_services,omitempty"`
AmbiguousServices []string `json:"ambiguous_services,omitempty"`
Findings []Finding `json:"findings,omitempty"`
RequiredSecrets []string `json:"required_secrets,omitempty"`
SecretCandidates []string `json:"secret_candidates,omitempty"`
SecretSources map[string]string `json:"secret_sources,omitempty"`
Ports []PortEvidence `json:"ports,omitempty"`
HealthChecks []Evidence `json:"health_checks,omitempty"`
DatabaseBootstrapServices []string `json:"database_bootstrap_services,omitempty"`
Declared []CapabilityIntent `json:"declared_capabilities,omitempty"`
Reconciliation []ReconciliationItem `json:"reconciliation,omitempty"`
}
type RuntimeOperation ¶ added in v0.4.8
type RuntimeOperation string
const ( RuntimeCreate RuntimeOperation = "runtime.create" RuntimeGet RuntimeOperation = "runtime.get" RuntimeDelete RuntimeOperation = "runtime.delete" RuntimeRotate RuntimeOperation = "runtime.rotate" )