Versions in this module Expand all Collapse all v0 v0.1.5 Feb 22, 2026 v0.1.1 Feb 22, 2026 v0.1.0 Feb 22, 2026 Changes in this version + var ErrContextNotFound = fmt.Errorf("platform context not found") + var ErrPlanAlreadyApplied = fmt.Errorf("plan has already been applied") + var ErrPlanExpired = fmt.Errorf("plan has expired and must be regenerated") + var ErrPlanNotApproved = fmt.Errorf("plan has not been approved") + var ErrProviderNotInitialized = fmt.Errorf("provider has not been initialized") + func ValidatePlatformConfig(cfg *PlatformConfig) error + type AuthzPolicy struct + AllowedOperations []string + AllowedTiers []Tier + Role TierRole + type CapabilityConfig struct + DependsOn []string + Name string + Properties map[string]any + Type string + type CapabilityDeclaration struct + Constraints []Constraint + DependsOn []string + Name string + Properties map[string]any + Tier Tier + Type string + type CapabilityMapper interface + CanMap func(capabilityType string) bool + Map func(decl CapabilityDeclaration, pctx *PlatformContext) ([]ResourcePlan, error) + ValidateConstraints func(decl CapabilityDeclaration, constraints []Constraint) []ConstraintViolation + type CapabilityType struct + Constraints []PropertySchema + Description string + Fidelity FidelityLevel + Name string + Properties []PropertySchema + Tier Tier + type CapabilityUnsupportedError struct + Capability string + Provider string + func (e *CapabilityUnsupportedError) Error() string + type Constraint struct + Field string + Operator string + Source string + Value any + type ConstraintConfig struct + Field string + Operator string + Value any + type ConstraintValidator struct + func NewConstraintValidator() *ConstraintValidator + func (cv *ConstraintValidator) Validate(properties map[string]any, constraints []Constraint) []ConstraintViolation + type ConstraintViolation struct + Actual any + Constraint Constraint + Message string + type ConstraintViolationError struct + Constraint string + Limit any + Resource string + Value any + func (e *ConstraintViolationError) Error() string + type ContextResolver interface + PropagateOutputs func(ctx context.Context, pctx *PlatformContext, outputs []*ResourceOutput) error + ResolveContext func(ctx context.Context, org, env, app string, tier Tier) (*PlatformContext, error) + ValidateTierBoundary func(pctx *PlatformContext, declarations []CapabilityDeclaration) []ConstraintViolation + type CredentialBroker interface + IssueCredential func(ctx context.Context, pctx *PlatformContext, request CredentialRequest) (*CredentialRef, error) + ListCredentials func(ctx context.Context, pctx *PlatformContext) ([]*CredentialRef, error) + ResolveCredential func(ctx context.Context, ref *CredentialRef) (string, error) + RevokeCredential func(ctx context.Context, ref *CredentialRef) error + RotateCredential func(ctx context.Context, ref *CredentialRef) (*CredentialRef, error) + type CredentialRef struct + ContextPath string + ExpiresAt time.Time + ID string + Name string + Provider string + SecretPath string + Tier Tier + type CredentialRequest struct + Name string + Renewable bool + Scope []string + TTL time.Duration + Type string + type CrossTierImpact struct + AffectedResources []DependencyRef + SourceDrift DriftResult + type DependencyRef struct + SourceContext string + SourceResource string + TargetContext string + TargetResource string + Type string + type DiffEntry struct + NewValue any + OldValue any + Path string + type DriftResult struct + Actual map[string]any + ContextPath string + Diffs []DiffEntry + DriftType string + Expected map[string]any + ResourceName string + ResourceType string + Tier Tier + type ExecutionConfig struct + LockTimeout string + ReconciliationInterval string + Tier1Mode string + Tier2Mode string + Tier3Mode string + type FidelityGap struct + Description string + Property string + Workaround string + type FidelityGapError struct + Capability string + Details string + Level FidelityLevel + Provider string + func (e *FidelityGapError) Error() string + type FidelityLevel string + const FidelityFull + const FidelityNone + const FidelityPartial + const FidelityStub + func WorseOf(a, b FidelityLevel) FidelityLevel + type FidelityReport struct + Capability string + Fidelity FidelityLevel + Gaps []FidelityGap + Provider string + func (fr *FidelityReport) HasGaps() bool + func (fr *FidelityReport) IsFullFidelity() bool + type HealthStatus struct + CheckedAt time.Time + Details map[string]any + Message string + Status string + type LockConflictError struct + ContextPath string + HeldBy string + func (e *LockConflictError) Error() string + type LockHandle interface + Refresh func(ctx context.Context, ttl time.Duration) error + Unlock func(ctx context.Context) error + type NotScalableError struct + ResourceType string + func (e *NotScalableError) Error() string + type Plan struct + Actions []PlanAction + ApprovedAt *time.Time + ApprovedBy string + Context string + CreatedAt time.Time + DryRun bool + FidelityReports []FidelityReport + ID string + Provider string + Status string + Tier Tier + type PlanAction struct + Action string + After map[string]any + Before map[string]any + Diff []DiffEntry + Provider string + ResourceName string + ResourceType string + type PlanConflictError struct + ConflictingResource string + PlanID string + func (e *PlanConflictError) Error() string + type PlatformConfig struct + Environment string + Execution ExecutionConfig + Org string + Provider ProviderConfig + Tiers TiersConfig + func ParsePlatformConfig(raw map[string]any) (*PlatformConfig, error) + type PlatformContext struct + Annotations map[string]string + Application string + Constraints []Constraint + Credentials map[string]string + Environment string + Labels map[string]string + Org string + ParentOutputs map[string]*ResourceOutput + Tier Tier + func (pc *PlatformContext) ContextPath() string + type PlatformRBAC interface + CanApprove func(ctx context.Context, principal string, tier Tier, contextPath string) (bool, error) + CanAuthor func(ctx context.Context, principal string, tier Tier, contextPath string) (bool, error) + CanView func(ctx context.Context, principal string, tier Tier, contextPath string) (bool, error) + EnforceConstraints func(pctx *PlatformContext, declarations []CapabilityDeclaration) ([]ConstraintViolation, error) + type PropertySchema struct + DefaultValue any + Description string + Name string + Required bool + Type string + type Provider interface + Capabilities func() []CapabilityType + Close func() error + CredentialBroker func() CredentialBroker + Healthy func(ctx context.Context) error + Initialize func(ctx context.Context, config map[string]any) error + MapCapability func(ctx context.Context, decl CapabilityDeclaration, pctx *PlatformContext) ([]ResourcePlan, error) + Name func() string + ResourceDriver func(resourceType string) (ResourceDriver, error) + StateStore func() StateStore + Version func() string + type ProviderConfig struct + Config map[string]any + Name string + type ProviderFactory func() Provider + type ReconcileResult struct + CheckedAt time.Time + ContextPath string + CrossTierImpacts []CrossTierImpact + DriftResults []DriftResult + Duration time.Duration + ResourcesChecked int + type Reconciler struct + func NewReconciler(provider Provider, store StateStore, contextPath string, ...) *Reconciler + func (r *Reconciler) Reconcile(ctx context.Context) (*ReconcileResult, error) + func (r *Reconciler) ReconcileJSON(ctx context.Context) ([]byte, error) + func (r *Reconciler) SetLogger(logger *log.Logger) + func (r *Reconciler) Start(ctx context.Context) error + type ReconcilerDriftReport struct + Actual map[string]any + ContextPath string + DetectedAt time.Time + Diffs []DiffEntry + DriftType string + Expected map[string]any + ID int64 + ResolvedAt *time.Time + ResolvedBy string + ResourceName string + ResourceType string + Tier Tier + type ReconcilerStateStore interface + SaveDriftReport func(ctx context.Context, report *ReconcilerDriftReport) error + type ResourceDriver interface + Create func(ctx context.Context, name string, properties map[string]any) (*ResourceOutput, error) + Delete func(ctx context.Context, name string) error + Diff func(ctx context.Context, name string, desired map[string]any) ([]DiffEntry, error) + HealthCheck func(ctx context.Context, name string) (*HealthStatus, error) + Read func(ctx context.Context, name string) (*ResourceOutput, error) + ResourceType func() string + Scale func(ctx context.Context, name string, scaleParams map[string]any) (*ResourceOutput, error) + Update func(ctx context.Context, name string, current, desired map[string]any) (*ResourceOutput, error) + type ResourceDriverNotFoundError struct + Provider string + ResourceType string + func (e *ResourceDriverNotFoundError) Error() string + type ResourceNotFoundError struct + Name string + Provider string + func (e *ResourceNotFoundError) Error() string + type ResourceOutput struct + ConnectionStr string + CredentialRef string + Endpoint string + LastSynced time.Time + Name string + Properties map[string]any + ProviderType string + Status ResourceStatus + Type string + type ResourcePlan struct + DependsOn []string + Name string + Properties map[string]any + ResourceType string + type ResourceStatus string + const ResourceStatusActive + const ResourceStatusCreating + const ResourceStatusDegraded + const ResourceStatusDeleted + const ResourceStatusDeleting + const ResourceStatusDrifted + const ResourceStatusFailed + const ResourceStatusPending + const ResourceStatusUpdating + type StateStore interface + AddDependency func(ctx context.Context, dep DependencyRef) error + DeleteResource func(ctx context.Context, contextPath, resourceName string) error + Dependencies func(ctx context.Context, contextPath, resourceName string) ([]DependencyRef, error) + GetPlan func(ctx context.Context, planID string) (*Plan, error) + GetResource func(ctx context.Context, contextPath, resourceName string) (*ResourceOutput, error) + ListPlans func(ctx context.Context, contextPath string, limit int) ([]*Plan, error) + ListResources func(ctx context.Context, contextPath string) ([]*ResourceOutput, error) + Lock func(ctx context.Context, contextPath string, ttl time.Duration) (LockHandle, error) + SavePlan func(ctx context.Context, plan *Plan) error + SaveResource func(ctx context.Context, contextPath string, output *ResourceOutput) error + type StdContextResolver struct + func NewStdContextResolver(store StateStore) *StdContextResolver + func (r *StdContextResolver) PropagateOutputs(ctx context.Context, pctx *PlatformContext, outputs []*ResourceOutput) error + func (r *StdContextResolver) RegisterConstraints(ctx context.Context, pctx *PlatformContext, constraints []Constraint) error + func (r *StdContextResolver) ResolveContext(ctx context.Context, org, env, app string, tier Tier) (*PlatformContext, error) + func (r *StdContextResolver) ValidateTierBoundary(pctx *PlatformContext, declarations []CapabilityDeclaration) []ConstraintViolation + type StdTemplateRegistry struct + func NewStdTemplateRegistry() *StdTemplateRegistry + func (r *StdTemplateRegistry) Get(_ context.Context, name, version string) (*WorkflowTemplate, error) + func (r *StdTemplateRegistry) GetLatest(_ context.Context, name string) (*WorkflowTemplate, error) + func (r *StdTemplateRegistry) List(_ context.Context) ([]*WorkflowTemplateSummary, error) + func (r *StdTemplateRegistry) Register(_ context.Context, template *WorkflowTemplate) error + func (r *StdTemplateRegistry) Resolve(_ context.Context, name, version string, params map[string]any) ([]CapabilityDeclaration, error) + type StdTierAuthorizer struct + func NewStdTierAuthorizer() *StdTierAuthorizer + func (a *StdTierAuthorizer) Authorize(_ context.Context, role TierRole, tier Tier, operation string) error + func (a *StdTierAuthorizer) RegisterPolicy(policy AuthzPolicy) + type TemplateOutput struct + Name string + Value string + type TemplateParameter struct + Default any + Description string + Name string + Required bool + Type string + Validation string + type TemplateRegistry interface + Get func(ctx context.Context, name, version string) (*WorkflowTemplate, error) + GetLatest func(ctx context.Context, name string) (*WorkflowTemplate, error) + List func(ctx context.Context) ([]*WorkflowTemplateSummary, error) + Register func(ctx context.Context, template *WorkflowTemplate) error + Resolve func(ctx context.Context, name, version string, params map[string]any) ([]CapabilityDeclaration, error) + type TemplateResolver struct + func NewTemplateResolver() *TemplateResolver + func (r *TemplateResolver) Resolve(template *WorkflowTemplate, params map[string]any) ([]CapabilityDeclaration, error) + type Tier int + const TierApplication + const TierInfrastructure + const TierSharedPrimitive + func (t Tier) String() string + func (t Tier) Valid() bool + type TierAuthorizer interface + Authorize func(ctx context.Context, role TierRole, tier Tier, operation string) error + RegisterPolicy func(policy AuthzPolicy) + type TierBoundaryError struct + Operation string + Reason string + SourceTier Tier + TargetTier Tier + func (e *TierBoundaryError) Error() string + type TierConfig struct + Capabilities []CapabilityConfig + ConstraintsForDownstream []ConstraintConfig + type TierRole string + const RoleTierAdmin + const RoleTierApprover + const RoleTierAuthor + const RoleTierViewer + type TiersConfig struct + Application TierConfig + Infrastructure TierConfig + SharedPrimitives TierConfig + type WorkflowTemplate struct + Capabilities []CapabilityDeclaration + Description string + Name string + Outputs []TemplateOutput + Parameters []TemplateParameter + Tier Tier + Version string + type WorkflowTemplateSummary struct + Description string + Name string + Parameters []string + Version string