Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyBinaryReplacement(sourcePath string, targetPath string, backupPath string, mode os.FileMode) error
- func CheckRuntimeCompatibility(compatibility Compatibility, installedApp InstalledApp) error
- func DesktopRuntimeMatchesBundle(paths compozyconfig.HomePaths, runtimePath string, bundlePath string, ...) (bool, error)
- func DesktopRuntimeNewerThanBundle(paths compozyconfig.HomePaths, binaryPath string, bundleVersion string) (bool, error)
- func ManualDirectBinaryRecommendation(releaseURL string, runtimeOS string) string
- func NewExecutorGeneration() (string, error)
- func RestoreBinaryReplacement(backupPath string, targetPath string, mode os.FileMode) error
- func RuntimeOwnedByDesktopApp(paths compozyconfig.HomePaths, binaryPath string) bool
- func ValidateReleaseArchive(archivePath string, binaryName string, policy ArtifactPolicy) error
- func WriteDesktopProvenance(paths compozyconfig.HomePaths, binaryPath string, ...) error
- type Actor
- type AppApplyRequest
- type AppApplyResult
- type AppOperationState
- type AppTrackState
- type AppliedBinary
- type ApplyObserver
- type ApplyStatus
- type ApplyStep
- type ArtifactIdentity
- type ArtifactKind
- type ArtifactPolicy
- type ArtifactSizeError
- type BinaryApplier
- type BlockedError
- type BundleVerifier
- type CheckOptions
- type Compatibility
- type Config
- type Coordinator
- type CoordinatorBinaryManager
- type CoordinatorConfig
- type CoordinatorManager
- type CoordinatorReleaseManager
- type CoordinatorRuntime
- type DesktopProvenanceMetadata
- type Holder
- type InstallMethod
- type InstalledApp
- type Manager
- func (m *Manager) AcquireOperation(ctx context.Context, request OperationRequest) (*Operation, error)
- func (m *Manager) ApplyRelease(ctx context.Context, release *Release) (AppliedBinary, error)
- func (m *Manager) ApplyReleaseObserved(ctx context.Context, release *Release, observer ApplyObserver) (AppliedBinary, error)
- func (m *Manager) Check(ctx context.Context, opts CheckOptions) (State, *Release, error)
- func (m *Manager) CheckAll(ctx context.Context, opts CheckOptions) (MultiState, *Release, error)
- func (m *Manager) Finalize(applied AppliedBinary) error
- func (m *Manager) OperationStore() *OperationStore
- func (m *Manager) PlanOperation(ctx context.Context, actor Actor, targets []Target, holder Holder) (request OperationRequest, returnErr error)
- func (m *Manager) PrimeInstallDetection(ctx context.Context) error
- func (m *Manager) ResolveReleaseByTag(ctx context.Context, tag string) (*Release, error)
- func (m *Manager) Restore(applied AppliedBinary) error
- func (m *Manager) RuntimeTargetPath() string
- func (m *Manager) Snapshot(ctx context.Context) (MultiState, error)
- type MultiState
- type MutationLock
- type Operation
- type OperationEvent
- type OperationEventEmitter
- type OperationEventName
- type OperationPhase
- type OperationRequest
- type OperationStore
- func (s *OperationStore) Acquire(ctx context.Context, request OperationRequest) (*Operation, error)
- func (s *OperationStore) Fence(ctx context.Context, operationID string, executorGeneration string, ...) error
- func (s *OperationStore) HolderLive(holder *Holder) bool
- func (s *OperationStore) LatestArchivedApp(ctx context.Context) (*Operation, error)
- func (s *OperationStore) LatestArchivedRuntime(ctx context.Context) (*Operation, error)
- func (s *OperationStore) Read(ctx context.Context) (*Operation, error)
- func (s *OperationStore) ReadArchived(ctx context.Context, operationID string) (*Operation, error)
- func (s *OperationStore) RequestAppApply(ctx context.Context, request AppApplyRequest) (AppApplyResult, error)
- func (s *OperationStore) Transition(ctx context.Context, operationID string, executorGeneration string, ...) (*Operation, error)
- func (s *OperationStore) VerifyAppArtifact(ctx context.Context, operationID string, executorGeneration string, ...) error
- type OperationView
- type Release
- type ReleaseAsset
- type RuntimeOperationState
- type RuntimeTrackState
- type State
- type Status
- type Target
- type TargetError
- type Transition
- type TransitionKind
- type UIPhase
- type WaitingState
Constants ¶
const ( DefaultOperationDeadline = 30 * time.Minute DefaultLeaseDuration = 2 * time.Minute )
const ManagedEnvName = "COMPOZY_MANAGED"
ManagedEnvName overrides the install-method detector for managed package installs.
const OperationSchemaVersion = 1
Variables ¶
var ( ErrOperationBlocked = errors.New("update: operation blocked") ErrOperationNotFound = errors.New("update: operation not found") ErrOperationConflict = errors.New("update: operation revision conflict") ErrExecutorFenced = errors.New("update: executor fenced") ErrOperationNotCancelable = errors.New("update: operation is not cancelable") )
var ErrNoCachedRelease = errors.New("update: cached release info not found")
Functions ¶
func ApplyBinaryReplacement ¶
func ApplyBinaryReplacement( sourcePath string, targetPath string, backupPath string, mode os.FileMode, ) error
ApplyBinaryReplacement atomically replaces a runtime binary and keeps a rollback copy.
func CheckRuntimeCompatibility ¶
func CheckRuntimeCompatibility(compatibility Compatibility, installedApp InstalledApp) error
CheckRuntimeCompatibility enforces the coordinator's runtime-only backstop.
func DesktopRuntimeMatchesBundle ¶
func DesktopRuntimeMatchesBundle( paths compozyconfig.HomePaths, runtimePath string, bundlePath string, metadata DesktopProvenanceMetadata, ) (bool, error)
DesktopRuntimeMatchesBundle verifies the installed bytes and release identity against a bundle.
func DesktopRuntimeNewerThanBundle ¶
func DesktopRuntimeNewerThanBundle( paths compozyconfig.HomePaths, binaryPath string, bundleVersion string, ) (bool, error)
DesktopRuntimeNewerThanBundle preserves a verified runtime installed by a newer release.
func ManualDirectBinaryRecommendation ¶
ManualDirectBinaryRecommendation returns the recovery path when in-place update is unavailable.
func NewExecutorGeneration ¶
NewExecutorGeneration returns a random lease fence for one executor process.
func RestoreBinaryReplacement ¶
RestoreBinaryReplacement restores a runtime binary from a rollback copy.
func RuntimeOwnedByDesktopApp ¶
func RuntimeOwnedByDesktopApp(paths compozyconfig.HomePaths, binaryPath string) bool
RuntimeOwnedByDesktopApp verifies the desktop ownership marker against the runtime bytes.
func ValidateReleaseArchive ¶
func ValidateReleaseArchive( archivePath string, binaryName string, policy ArtifactPolicy, ) error
ValidateReleaseArchive checks one direct-update archive without applying its binary.
func WriteDesktopProvenance ¶
func WriteDesktopProvenance( paths compozyconfig.HomePaths, binaryPath string, metadata DesktopProvenanceMetadata, ) error
WriteDesktopProvenance records that the desktop app installed the runtime binary.
Types ¶
type AppApplyRequest ¶
type AppApplyRequest struct {
RequestedBy Actor
App AppOperationState
Holder Holder
Deadline time.Time
}
AppApplyRequest binds a shell apply request to one verified artifact identity.
type AppApplyResult ¶
type AppApplyResult struct {
Target Target `json:"target"`
Status ApplyStatus `json:"status"`
OperationID string `json:"operation_id,omitempty"`
Message string `json:"message"`
Holder *Holder `json:"holder,omitempty"`
}
AppApplyResult reports durable acquisition, never a terminal install verdict.
type AppOperationState ¶
type AppOperationState struct {
ArtifactIdentity
AttemptID string `json:"attempt_id"`
Phase OperationPhase `json:"phase"`
DigestVerified bool `json:"digest_verified"`
ConsecutiveFailures int `json:"consecutive_failures"`
WatchdogDeadline time.Time `json:"watchdog_deadline,omitzero"`
}
AppOperationState journals the desktop app track.
type AppTrackState ¶
type AppTrackState struct {
Status Status `json:"status"`
Running bool `json:"running"`
CurrentVersion string `json:"current_version"`
LatestVersion string `json:"latest_version,omitempty"`
ReleaseURL string `json:"release_url,omitempty"`
AttemptID string `json:"attempt_id,omitempty"`
LastError string `json:"last_error,omitempty"`
Message string `json:"message"`
}
AppTrackState is present exactly when a desktop app is installed.
type AppliedBinary ¶
type AppliedBinary struct {
TargetPath string
BackupPath string
Version string
PreviousVersion string
InstallMethod InstallMethod
}
AppliedBinary describes one on-disk binary swap that still retains a rollback backup.
type ApplyObserver ¶
ApplyObserver journals and fences one apply step before the manager performs it.
type ApplyStatus ¶
type ApplyStatus string
ApplyStatus is the settings/app request acceptance vocabulary.
const ( ApplyStatusAccepted ApplyStatus = "accepted" ApplyStatusBlocked ApplyStatus = "blocked" ApplyStatusFailed ApplyStatus = "failed" )
type ApplyStep ¶
type ApplyStep struct {
Phase OperationPhase
Percent int
BackupPath string
Compatibility *Compatibility
}
ApplyStep reports the next journal phase immediately before its work begins.
type ArtifactIdentity ¶
type ArtifactIdentity struct {
FromVersion string `json:"from_version"`
ToVersion string `json:"to_version"`
ReleaseTag string `json:"release_tag"`
Asset string `json:"asset"`
Digest string `json:"digest"`
}
ArtifactIdentity binds an update step to one verified release artifact.
type ArtifactKind ¶
type ArtifactKind string
ArtifactKind identifies the release artifact constrained by the update policy.
const ( ArtifactKindArchive ArtifactKind = "archive" ArtifactKindBinary ArtifactKind = "binary" )
type ArtifactPolicy ¶
ArtifactPolicy defines the accepted size envelope for direct self-update artifacts.
func DefaultArtifactPolicy ¶
func DefaultArtifactPolicy() ArtifactPolicy
DefaultArtifactPolicy returns the size envelope enforced by runtime updates and release publication.
type ArtifactSizeError ¶
type ArtifactSizeError struct {
Kind ArtifactKind
Size int64
Limit int64
}
ArtifactSizeError reports a release artifact outside the accepted size envelope.
func (*ArtifactSizeError) Error ¶
func (e *ArtifactSizeError) Error() string
type BinaryApplier ¶
type BinaryApplier interface {
ApplyBinary(sourcePath string, targetPath string, backupPath string, mode os.FileMode) error
RestoreBinary(backupPath string, targetPath string, mode os.FileMode) error
}
BinaryApplier atomically swaps the current executable with a verified replacement.
type BlockedError ¶
type BlockedError struct {
Operation Operation
}
BlockedError reports the live operation that prevented acquisition.
func (*BlockedError) Error ¶
func (e *BlockedError) Error() string
func (*BlockedError) Unwrap ¶
func (e *BlockedError) Unwrap() error
type BundleVerifier ¶
type BundleVerifier interface {
VerifyChecksums(ctx context.Context, checksumsPath string, bundlePath string) error
}
BundleVerifier verifies the signed checksum catalog before the archive checksum is trusted.
type CheckOptions ¶
CheckOptions customize one update status query.
type Compatibility ¶
type Compatibility struct {
RuntimeVersion string `json:"runtime_version"`
MinAppVersion string `json:"min_app_version"`
}
Compatibility is the signed two-field release compatibility contract.
type Config ¶
type Config struct {
HomePaths compozyconfig.HomePaths
CurrentVersion string
ExecutablePath func() (string, error)
ResolveSymlinks func(string) (string, error)
Getenv func(string) string
Now func() time.Time
HTTPClient *http.Client
RuntimeOS string
RuntimeArch string
LookPath func(string) (string, error)
RunCommand func(context.Context, string, ...string) (string, error)
BundleVerifier BundleVerifier
BinaryApplier BinaryApplier
ArtifactPolicy ArtifactPolicy
OperationEvents OperationEventEmitter
}
Config builds one update manager bound to the current runtime.
type Coordinator ¶
type Coordinator struct {
// contains filtered or unexported fields
}
Coordinator executes and recovers one durable update operation.
func NewCoordinator ¶
func NewCoordinator(cfg CoordinatorConfig) (*Coordinator, error)
NewCoordinator constructs a detached-operation executor.
type CoordinatorBinaryManager ¶
type CoordinatorBinaryManager interface {
RuntimeTargetPath() string
Restore(AppliedBinary) error
Finalize(AppliedBinary) error
}
CoordinatorBinaryManager supplies installed-runtime mutation and recovery.
type CoordinatorConfig ¶
type CoordinatorConfig struct {
Store *OperationStore
ReleaseManager CoordinatorReleaseManager
BinaryManager CoordinatorBinaryManager
Runtime CoordinatorRuntime
LeaseDuration time.Duration
RenewInterval time.Duration
Now func() time.Time
}
CoordinatorConfig wires the sole runtime-mutation executor.
type CoordinatorManager ¶
type CoordinatorManager interface {
CoordinatorReleaseManager
CoordinatorBinaryManager
}
CoordinatorManager is the complete manager capability implemented by Manager.
type CoordinatorReleaseManager ¶
type CoordinatorReleaseManager interface {
ResolveReleaseByTag(context.Context, string) (*Release, error)
ApplyReleaseObserved(context.Context, *Release, ApplyObserver) (AppliedBinary, error)
}
CoordinatorReleaseManager supplies verified release acquisition and application.
type CoordinatorRuntime ¶
type CoordinatorRuntime interface {
AcquireMutationLock(context.Context) (MutationLock, error)
RestartDaemon(context.Context) error
HealthCheck(context.Context) error
InstalledApp(context.Context) (InstalledApp, error)
}
CoordinatorRuntime bridges process lifecycle operations owned outside internal/update.
type DesktopProvenanceMetadata ¶
DesktopProvenanceMetadata binds a desktop-owned runtime to its app release.
type Holder ¶
type Holder struct {
PID int `json:"pid"`
PIDStartTime time.Time `json:"pid_start_time"`
Surface Actor `json:"surface"`
ExecutorGeneration string `json:"executor_generation"`
LeaseExpiresAt time.Time `json:"lease_expires_at"`
}
Holder is the fenced lease for the sole active executor.
type InstallMethod ¶
type InstallMethod string
InstallMethod reports how the running CompozyOS binary was installed.
const ( InstallMethodDirectBinary InstallMethod = "direct-binary" InstallMethodHomebrew InstallMethod = "homebrew" InstallMethodNPM InstallMethod = "npm" InstallMethodAPT InstallMethod = "apt" InstallMethodDNF InstallMethod = "dnf" InstallMethodRPM InstallMethod = "rpm" InstallMethodScoop InstallMethod = "scoop" InstallMethodGoInstall InstallMethod = "go-install" InstallMethodDesktopApp InstallMethod = "desktop-app" InstallMethodUnknown InstallMethod = "unknown" )
type InstalledApp ¶
InstalledApp preserves the difference between no desktop app and an app whose version is unreadable.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager owns the CompozyOS self-update flow for the current runtime.
func NewManager ¶
NewManager binds the update flow to the current CompozyOS runtime.
func (*Manager) AcquireOperation ¶
func (m *Manager) AcquireOperation(ctx context.Context, request OperationRequest) (*Operation, error)
AcquireOperation publishes one verified update plan.
func (*Manager) ApplyRelease ¶
ApplyRelease downloads, verifies, extracts, and swaps in the supplied release.
func (*Manager) ApplyReleaseObserved ¶
func (m *Manager) ApplyReleaseObserved( ctx context.Context, release *Release, observer ApplyObserver, ) (AppliedBinary, error)
ApplyReleaseObserved exposes real apply boundaries to the operation coordinator.
func (*Manager) Check ¶
Check returns the current update state and the latest release metadata when available.
func (*Manager) CheckAll ¶
func (m *Manager) CheckAll(ctx context.Context, opts CheckOptions) (MultiState, *Release, error)
CheckAll computes both installed tracks and the live operation from one release lookup.
func (*Manager) Finalize ¶
func (m *Manager) Finalize(applied AppliedBinary) error
Finalize removes the preserved sibling backup after the full update flow succeeds.
func (*Manager) OperationStore ¶
func (m *Manager) OperationStore() *OperationStore
OperationStore exposes the single journal authority to composition roots.
func (*Manager) PlanOperation ¶
func (m *Manager) PlanOperation( ctx context.Context, actor Actor, targets []Target, holder Holder, ) (request OperationRequest, returnErr error)
PlanOperation verifies release identities and builds a durable acquisition request.
func (*Manager) PrimeInstallDetection ¶
PrimeInstallDetection resolves and memoizes the install method for this manager.
func (*Manager) ResolveReleaseByTag ¶
ResolveReleaseByTag fetches the immutable release identity recorded by an operation.
func (*Manager) Restore ¶
func (m *Manager) Restore(applied AppliedBinary) error
Restore rolls back an applied binary swap using the preserved sibling backup.
func (*Manager) RuntimeTargetPath ¶
RuntimeTargetPath returns the concrete executable path owned by this manager.
type MultiState ¶
type MultiState struct {
Aggregate Status `json:"aggregate"`
Operation *OperationView `json:"operation"`
Runtime RuntimeTrackState `json:"runtime"`
App *AppTrackState `json:"app"`
}
MultiState is the live host-global projection shared by settings and app status.
func ProjectMultiState ¶
func ProjectMultiState(runtime State, app *AppTrackState, operation *Operation) MultiState
ProjectMultiState derives every live track and operation field from one computation.
type MutationLock ¶
type MutationLock interface {
Release() error
}
MutationLock is the short critical-section lock held only around the runtime swap.
type Operation ¶
type Operation struct {
SchemaVersion int `json:"schema_version"`
ID string `json:"operation_id"`
RequestedBy Actor `json:"requested_by"`
Revision int64 `json:"revision"`
Targets []Target `json:"targets"`
ActiveTarget Target `json:"active_target,omitempty"`
Percent int `json:"percent"`
Runtime *RuntimeOperationState `json:"runtime,omitempty"`
App *AppOperationState `json:"app,omitempty"`
Holder *Holder `json:"holder"`
Waiting WaitingState `json:"waiting"`
Deadline time.Time `json:"deadline"`
StartedAt time.Time `json:"started_at"`
UpdatedAt time.Time `json:"updated_at"`
LastError string `json:"last_error,omitempty"`
Outcome string `json:"outcome,omitempty"`
}
Operation is the sole durable mutation journal for one CompozyOS home.
type OperationEvent ¶
type OperationEvent struct {
Name OperationEventName `json:"name"`
OperationID string `json:"operation_id"`
Revision int64 `json:"revision"`
Target Target `json:"target"`
InstallMethod InstallMethod `json:"install_method"`
FromVersion string `json:"from_version"`
ToVersion string `json:"to_version"`
Actor Actor `json:"actor"`
ExecutorGeneration string `json:"executor_generation,omitempty"`
Outcome string `json:"outcome"`
OccurredAt time.Time `json:"occurred_at"`
}
OperationEvent carries safe correlation fields for one journal transition.
type OperationEventEmitter ¶
type OperationEventEmitter interface {
EmitUpdateEvent(context.Context, OperationEvent)
}
OperationEventEmitter receives events at the transition call site.
func NewSlogOperationEventEmitter ¶
func NewSlogOperationEventEmitter(logger *slog.Logger) OperationEventEmitter
NewSlogOperationEventEmitter writes canonical lifecycle events to structured logs.
type OperationEventName ¶
type OperationEventName string
OperationEventName is the closed update lifecycle event vocabulary.
const ( EventOperationAcquired OperationEventName = "update.operation.acquired" EventOperationBlocked OperationEventName = "update.operation.blocked" EventOperationWaiting OperationEventName = "update.operation.waiting" EventOperationResumed OperationEventName = "update.operation.resumed" EventOperationCanceled OperationEventName = "update.operation.canceled" EventOperationCancelDeclined OperationEventName = "update.operation.cancel_declined" EventLeaseAcquired OperationEventName = "update.lease.acquired" EventLeaseRenewed OperationEventName = "update.lease.renewed" EventLeaseExpired OperationEventName = "update.lease.expired" EventCheckCompleted OperationEventName = "update.check.completed" EventDownloadProgress OperationEventName = "update.download.progress" EventVerifyCompleted OperationEventName = "update.verify.completed" EventSwapCompleted OperationEventName = "update.swap.completed" EventRestartCompleted OperationEventName = "update.restart.completed" EventHealthCompleted OperationEventName = "update.health.completed" EventFinalized OperationEventName = "update.finalized" EventRolledBack OperationEventName = "update.rolled_back" EventAppStaged OperationEventName = "update.app.staged" EventAppApplying OperationEventName = "update.app.applying" EventAppInstallerHandoff OperationEventName = "update.app.installer_handoff" EventAppVerified OperationEventName = "update.app.verified" EventAppFailed OperationEventName = "update.app.failed" EventOperationRecovered OperationEventName = "update.operation.recovered" )
type OperationPhase ¶
type OperationPhase string
OperationPhase is the closed union of runtime and app journal phases.
const ( PhasePending OperationPhase = "pending" PhaseDownloading OperationPhase = "downloading" PhaseVerifying OperationPhase = "verifying" PhaseSwapping OperationPhase = "swapping" PhaseRestarting OperationPhase = "restarting" PhaseHealthChecking OperationPhase = "health-checking" PhaseFinalized OperationPhase = "finalized" PhaseRolledBack OperationPhase = "rolled-back" PhaseFailed OperationPhase = "failed" PhaseStaged OperationPhase = "staged" PhaseApplying OperationPhase = "applying" PhaseInstallerHandoff OperationPhase = "installer-handoff" PhaseRestarted OperationPhase = "restarted" PhaseVerified OperationPhase = "verified" )
type OperationRequest ¶
type OperationRequest struct {
RequestedBy Actor
Targets []Target
Runtime *RuntimeOperationState
App *AppOperationState
Holder Holder
Deadline time.Time
}
OperationRequest contains release identities already verified at acquisition.
type OperationStore ¶
type OperationStore struct {
// contains filtered or unexported fields
}
OperationStore owns all reads and writes of the per-home update journal.
func NewOperationStore ¶
func NewOperationStore(paths compozyconfig.HomePaths, events OperationEventEmitter) (*OperationStore, error)
NewOperationStore binds the journal to one CompozyOS home.
func (*OperationStore) Acquire ¶
func (s *OperationStore) Acquire(ctx context.Context, request OperationRequest) (*Operation, error)
Acquire creates the sole operation or resumes an eligible dormant operation.
func (*OperationStore) Fence ¶
func (s *OperationStore) Fence( ctx context.Context, operationID string, executorGeneration string, expectedRevision int64, ) error
Fence proves that a caller still owns the exact revision immediately before an irreversible side effect.
func (*OperationStore) HolderLive ¶
func (s *OperationStore) HolderLive(holder *Holder) bool
HolderLive reports whether the lease still belongs to the recorded process identity.
func (*OperationStore) LatestArchivedApp ¶
func (s *OperationStore) LatestArchivedApp(ctx context.Context) (*Operation, error)
LatestArchivedApp returns the newest terminal operation containing the app track.
func (*OperationStore) LatestArchivedRuntime ¶
func (s *OperationStore) LatestArchivedRuntime(ctx context.Context) (*Operation, error)
LatestArchivedRuntime returns the newest terminal operation containing the runtime track.
func (*OperationStore) Read ¶
func (s *OperationStore) Read(ctx context.Context) (*Operation, error)
Read returns the validated live operation, or nil when no operation exists.
func (*OperationStore) ReadArchived ¶
ReadArchived returns one terminal operation from the durable audit trail.
func (*OperationStore) RequestAppApply ¶
func (s *OperationStore) RequestAppApply(ctx context.Context, request AppApplyRequest) (AppApplyResult, error)
RequestAppApply durably records a verified app asset and returns acceptance truth.
func (*OperationStore) Transition ¶
func (s *OperationStore) Transition( ctx context.Context, operationID string, executorGeneration string, expectedRevision int64, transition Transition, ) (*Operation, error)
Transition applies one fenced compare-and-swap mutation to the live journal.
func (*OperationStore) VerifyAppArtifact ¶
func (s *OperationStore) VerifyAppArtifact( ctx context.Context, operationID string, executorGeneration string, expectedRevision int64, attemptID string, path string, ) error
VerifyAppArtifact binds a shell attempt to the exact asset recorded in the operation.
type OperationView ¶
type OperationView struct {
ID string `json:"id"`
Revision int64 `json:"revision"`
Targets []Target `json:"targets"`
ActiveTarget Target `json:"active_target,omitempty"`
Phase OperationPhase `json:"phase,omitempty"`
Percent int `json:"percent"`
Holder *Holder `json:"holder"`
Waiting WaitingState `json:"waiting"`
StartedAt time.Time `json:"started_at"`
LastError string `json:"last_error,omitempty"`
}
OperationView is the transport-safe read projection of the durable journal.
type Release ¶
type Release struct {
Version string
ReleaseURL string
PublishedAt time.Time
Assets []ReleaseAsset
}
Release holds the metadata required to inspect or apply one release.
type ReleaseAsset ¶
ReleaseAsset identifies one downloadable release artifact.
type RuntimeOperationState ¶
type RuntimeOperationState struct {
ArtifactIdentity
InstallMethod InstallMethod `json:"install_method"`
BackupPath string `json:"backup_path,omitempty"`
Phase OperationPhase `json:"phase"`
DaemonRestarted bool `json:"daemon_restarted"`
}
RuntimeOperationState journals the runtime track.
type RuntimeTrackState ¶
type RuntimeTrackState struct {
Status Status `json:"status"`
InstallMethod string `json:"install_method"`
Managed bool `json:"managed"`
CurrentVersion string `json:"current_version"`
LatestVersion string `json:"latest_version,omitempty"`
ReleaseURL string `json:"release_url,omitempty"`
Recommendation string `json:"recommendation,omitempty"`
RestoredVersion string `json:"restored_version,omitempty"`
DaemonRestarted bool `json:"daemon_restarted"`
Message string `json:"message"`
LastError string `json:"last_error,omitempty"`
}
RuntimeTrackState is the complete runtime update projection.
type State ¶
type State struct {
Supported bool `json:"supported"`
Managed bool `json:"managed"`
InstallMethod string `json:"install_method"`
CurrentVersion string `json:"current_version"`
LatestVersion string `json:"latest_version,omitempty"`
Available bool `json:"available"`
Status Status `json:"status"`
Recommendation string `json:"recommendation,omitempty"`
ReleaseURL string `json:"release_url,omitempty"`
CheckedAt *time.Time `json:"checked_at,omitempty"`
LastError string `json:"last_error,omitempty"`
Message string `json:"message,omitempty"`
RestoredVersion string `json:"restored_version,omitempty"`
DaemonRestarted bool `json:"daemon_restarted"`
}
State is the transport-safe update status snapshot shared by CLI and API surfaces.
type Status ¶
type Status string
Status reports the operator-facing update state.
const ( StatusUpToDate Status = "up-to-date" StatusAvailable Status = "available" StatusAccepted Status = "accepted" StatusApplying Status = "applying" StatusStaged Status = "staged" StatusUpdated Status = "updated" StatusFailed Status = "failed" StatusBlocked Status = "blocked" StatusUnsupported Status = "unsupported" StatusCanceled Status = "canceled" )
func AggregateLiveStatus ¶
AggregateLiveStatus applies the frozen live status precedence.
func AggregateTerminalStatus ¶
AggregateTerminalStatus applies the frozen CLI terminal precedence.
type Target ¶
type Target string
Target identifies one install track in a host-global update operation.
func ErrorTarget ¶
ErrorTarget returns the track carried by a planning error.
type TargetError ¶
TargetError identifies the update track that produced a planning failure.
func (*TargetError) Error ¶
func (e *TargetError) Error() string
func (*TargetError) Unwrap ¶
func (e *TargetError) Unwrap() error
type Transition ¶
type Transition struct {
Kind TransitionKind
Actor Actor
Target Target
Phase OperationPhase
Percent int
Holder *Holder
BackupPath string
LastError string
Outcome string
AppWatchdogDeadline *time.Time
IncrementAppFailures bool
ResetAppFailures bool
}
Transition is the declarative input to the sole operation mutation API.
type TransitionKind ¶
type TransitionKind string
TransitionKind identifies one journal mutation.
const ( TransitionPhase TransitionKind = "phase" TransitionProgress TransitionKind = "progress" TransitionWaitForApp TransitionKind = "wait-for-app" TransitionAcquireLease TransitionKind = "acquire-lease" TransitionRenewLease TransitionKind = "renew-lease" TransitionRecover TransitionKind = "recover" TransitionCancel TransitionKind = "cancel" TransitionVerifyApp TransitionKind = "verify-app-artifact" )
type UIPhase ¶
type UIPhase string
UIPhase is the fixed user-facing lifecycle vocabulary.
func PhaseForUI ¶
func PhaseForUI(target Target, phase OperationPhase, percent int) (UIPhase, bool)
PhaseForUI maps every measurable operation edge to the fixed UI phase vocabulary.
type WaitingState ¶
type WaitingState string
WaitingState identifies an operation that is durable but has no live holder.
const ( WaitingNone WaitingState = "" WaitingForApp WaitingState = "waiting-for-app" )
Source Files
¶
- app_apply.go
- app_digest.go
- app_failure.go
- apply.go
- artifact_policy.go
- cache.go
- compatibility.go
- coordinator.go
- coordinator_runtime.go
- coordinator_state.go
- coordinator_types.go
- detect.go
- github.go
- manager.go
- manager_apply.go
- manager_archive.go
- manager_state.go
- multi_check.go
- operation_archive.go
- operation_event_mapping.go
- operation_events.go
- operation_files.go
- operation_reconcile.go
- operation_store.go
- operation_transition.go
- operation_types.go
- path_helpers.go
- plan.go
- projection.go
- provenance.go
- release_track.go
- resource_cleanup.go
- target_error.go
- types.go
- verify.go
- version.go