Documentation
¶
Overview ¶
Package servicecontrol owns the local, owner-approved desired state and bounded execution contract for StackKits-managed services.
Index ¶
Constants ¶
View Source
const ( StateAPIVersion = "stackkit.service-desired-state/v1" ResultAPIVersion = "stackkit.service-action-result/v1" LogsAPIVersion = "stackkit.service-logs/v1" ActionStart = "start" ActionStop = "stop" ActionRestart = "restart" ActionLogs = "logs" DesiredRunning = "running" DesiredStopped = "stopped" ReasonCriticalControlPlane = "critical_control_plane" ReasonPlanChanged = "desired_state_plan_changed" ReasonContractChanged = "desired_state_contract_changed" ReasonUnknownService = "unknown_service" ReasonOwnerApproval = "owner_approval_required" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewOSController ¶
func NewOSController(workspace, planPath string, plan generationartifact.VerifiedPlan) (*Controller, error)
func (*Controller) Logs ¶
func (c *Controller) Logs(ctx context.Context, serviceKey string, tail int, cursor string) (LogsResult, error)
func (*Controller) ReconcileAfterApply ¶
func (c *Controller) ReconcileAfterApply(ctx context.Context) error
ReconcileAfterApply reapplies durable stopped intent through the declared adapter. Any plan or service-contract change invalidates the state fail-closed.
type DesiredService ¶
type DesiredState ¶
type DesiredState struct {
APIVersion string `json:"apiVersion"`
OwnerRef string `json:"ownerRef"`
PlanHash string `json:"planHash"`
ServiceContractHash string `json:"serviceContractHash"`
Revision uint64 `json:"revision"`
Services map[string]DesiredService `json:"services"`
UpdatedAt time.Time `json:"updatedAt"`
Signature localevidence.OwnerPolicyStateSignature `json:"signature"`
}
type LogsResult ¶
type Result ¶
type Result struct {
APIVersion string `json:"apiVersion"`
Action string `json:"action"`
ServiceKey string `json:"serviceKey"`
DesiredState string `json:"desiredState"`
ObservedState string `json:"observedState"`
Revision uint64 `json:"revision"`
Checks []Check `json:"checks"`
ReasonCode string `json:"reasonCode,omitempty"`
Retryable bool `json:"retryable"`
OperationRef string `json:"operationRef,omitempty"`
EvidenceRef string `json:"evidenceRef,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.