Documentation
¶
Overview ¶
Package controlplane defines the public administrative domain contracts.
Index ¶
Constants ¶
const ( // MaxIdentityBytes matches the durable and data-plane identity bounds. MaxIdentityBytes = 256 // MaxReasonBytes bounds actor-supplied administrative audit reasons. MaxReasonBytes = 1_024 // MaxFailureBytes bounds stable public command failure codes. MaxFailureBytes = 256 )
const ( // DefaultCommandLifetime is the bounded enforcement window assigned when a // caller does not supply a narrower deadline. DefaultCommandLifetime time.Duration = 30_000_000_000 // MaxCommandLifetime prevents administrative work from remaining live // indefinitely across request and adapter boundaries. MaxCommandLifetime time.Duration = 300_000_000_000 )
const ( // FailureDispatch is the redacted public code for a data-plane dispatch // failure. Raw adapter errors must not be exposed through administrative API // models because they may contain credentials or backend endpoints. FailureDispatch = "dispatch_failed" // FailureOutcomeUnknown reports that enforcement may have occurred but no // reliable acknowledgement was available. FailureOutcomeUnknown = "outcome_unknown" // FailureInvalidDispatchResult reports malformed adapter output without // exposing its contents. FailureInvalidDispatchResult = "invalid_dispatch_result" // FailureDeadlineExceeded reports a command whose enforcement window closed // before it reached a tenant controller. FailureDeadlineExceeded = "deadline_exceeded" // FailureCanceled reports cancellation before a command crossed the // durable dispatch boundary. Once dispatched, cancellation is not claimed. FailureCanceled = "canceled" )
const MaxBulkSelection uint32 = 1_000
MaxBulkSelection is the largest destructive selection accepted by one command. Callers must paginate larger administrative workflows.
const MaxScaleReplicas uint32 = 10_000
MaxScaleReplicas bounds one explicitly authorized scaling request.
Variables ¶
This section is empty.
Functions ¶
func NewCommandID ¶
NewCommandID allocates one opaque lowercase ULID operation identifier.
Types ¶
type Action ¶
type Action string
Action identifies an administrative mutation.
const ( ActionPause Action = "pause" ActionResume Action = "resume" ActionDrain Action = "drain" ActionTerminate Action = "terminate" ActionRetry Action = "retry" ActionBulkRetry Action = "bulk_retry" ActionDelete Action = "delete" ActionPurge Action = "purge" ActionReplay Action = "replay" ActionScale Action = "scale" )
type Command ¶
type Command struct {
CommandID string
IdempotencyKey string
TenantID string
Actor string
AuthenticationMethod string
Reason string
Action Action
Capability string
Target Target
RequestedAt time.Time
Deadline time.Time
Confirmed bool
Selection *Selection
Replay *Replay
Scale *Scale
}
Command is the mandatory envelope for every administrative mutation.
type CommandResult ¶
type CommandResult struct {
CommandID string `json:"command_id"`
IdempotencyKey string `json:"idempotency_key"`
TenantID string `json:"tenant_id"`
Status CommandStatus `json:"status"`
Failure string `json:"failure,omitempty"`
WorkerID string `json:"worker_id,omitempty"`
Protocol *ProtocolVersion `json:"protocol,omitempty"`
CapabilityAvailable *bool `json:"capability_available,omitempty"`
DispatchedAt time.Time `json:"dispatched_at,omitempty"`
AcknowledgedAt time.Time `json:"acknowledged_at,omitempty"`
CompletedAt time.Time `json:"completed_at,omitempty"`
}
CommandResult is the durable result associated with an idempotency key.
func (CommandResult) Validate ¶
func (r CommandResult) Validate() error
Validate rejects malformed or internally inconsistent durable results.
type CommandStatus ¶
type CommandStatus string
CommandStatus is the durable administrative outcome presented to clients.
const ( CommandPending CommandStatus = "pending" CommandAccepted CommandStatus = "accepted" CommandDispatched CommandStatus = "dispatched" CommandAcknowledged CommandStatus = "acknowledged" CommandSucceeded CommandStatus = "succeeded" CommandFailed CommandStatus = "failed" CommandUnsupported CommandStatus = "unsupported" CommandTimedOut CommandStatus = "timed_out" CommandPartial CommandStatus = "partial" CommandUnknown CommandStatus = "unknown" CommandCanceled CommandStatus = "canceled" )
type Permission ¶
type Permission string
Permission is the explicit authorization capability required by an action.
const ( PermissionView Permission = "view" PermissionPause Permission = "pause" PermissionResume Permission = "resume" PermissionDrain Permission = "drain" PermissionTerminate Permission = "terminate" PermissionRetry Permission = "retry" PermissionBulkRetry Permission = "bulk_retry" PermissionDelete Permission = "delete" PermissionPurge Permission = "purge" PermissionReplay Permission = "replay" PermissionScale Permission = "scale" PermissionRecordList Permission = "record_list" PermissionRecordInspect Permission = "record_inspect" PermissionPayloadView Permission = "payload_view" PermissionDiagnosticsView Permission = "diagnostics_view" PermissionAuditView Permission = "audit_view" PermissionRetentionConfigure Permission = "retention_configure" )
type ProtocolVersion ¶
ProtocolVersion identifies the data-plane protocol that acknowledged a command without coupling this package to an adapter implementation.
type Replay ¶
type Replay struct {
Destination string
IdempotencyPolicy ReplayPolicy
}
Replay contains the explicit destination and idempotency semantics required for a replay command.
type ReplayPolicy ¶
type ReplayPolicy string
ReplayPolicy declares how duplicate destination identities are handled.
const ( ReplayRejectDuplicate ReplayPolicy = "reject_duplicate" ReplayReplaceDuplicate ReplayPolicy = "replace_duplicate" )
type Scale ¶
type Scale struct {
Replicas uint32
}
Scale declares the desired Kubernetes workload replica count.
type Selection ¶
type Selection struct {
Limit uint32
}
Selection bounds a bulk administrative mutation.
type SensitiveAccess ¶
type SensitiveAccess struct {
CommandID string
TenantID string
Actor string
Permission Permission
Target Target
OccurredAt time.Time
}
SensitiveAccess is one fail-closed audit record for privileged record data.
func (SensitiveAccess) Validate ¶
func (a SensitiveAccess) Validate() error
Validate rejects unscoped or non-sensitive access audit records.
type Target ¶
type Target struct {
Kind TargetKind
Name string
}
Target identifies an administrative resource without exposing backend addressing or queue serialization details.
type TargetKind ¶
type TargetKind string
TargetKind identifies the resource affected by a command.
const ( TargetQueue TargetKind = "queue" TargetWorker TargetKind = "worker" TargetWorkerGroup TargetKind = "worker_group" TargetFailure TargetKind = "failure" TargetDeadLetter TargetKind = "dead_letter" TargetWorkload TargetKind = "workload" )
type ValidationError ¶
ValidationError is a machine-readable public contract for invalid input.
Directories
¶
| Path | Synopsis |
|---|---|
|
_browser
|
|
|
testserver
command
|
|
|
Package alerts derives bounded alert inputs from validated operational snapshots without delivering notifications or storing time series.
|
Package alerts derives bounded alert inputs from validated operational snapshots without delivering notifications or storing time series. |
|
Package apihttp provides the versioned administrative HTTP API.
|
Package apihttp provides the versioned administrative HTTP API. |
|
Package authz integrates control-plane mutations with authorization.
|
Package authz integrates control-plane mutations with authorization. |
|
Package cli implements the administrative command-line workflow.
|
Package cli implements the administrative command-line workflow. |
|
Package client provides a typed bounded administrative API client.
|
Package client provides a typed bounded administrative API client. |
|
cmd
|
|
|
queue-control
command
|
|
|
queue-control-plane
command
|
|
|
Package control orchestrates administrative desired-state mutations.
|
Package control orchestrates administrative desired-state mutations. |
|
Package dataplane adapts stable queue management contracts without acquiring backend-native clients or reimplementing queue semantics.
|
Package dataplane adapts stable queue management contracts without acquiring backend-native clients or reimplementing queue semantics. |
|
Package fleet models worker liveness and compatibility without supervising worker processes or implementing queue delivery semantics.
|
Package fleet models worker liveness and compatibility without supervising worker processes or implementing queue delivery semantics. |
|
Package history defines bounded operational and append-only audit contracts.
|
Package history defines bounded operational and append-only audit contracts. |
|
Package kubernetes exposes the deliberately narrow Kubernetes integration.
|
Package kubernetes exposes the deliberately narrow Kubernetes integration. |
|
Package postgres provides PostgreSQL persistence for control-plane state.
|
Package postgres provides PostgreSQL persistence for control-plane state. |
|
Package server owns the bounded administrative HTTP server lifecycle.
|
Package server owns the bounded administrative HTTP server lifecycle. |
|
Package ui serves the optional embedded administrative web console.
|
Package ui serves the optional embedded administrative web console. |