Documentation
¶
Index ¶
- Constants
- func NewTransactionID() (string, error)
- func NormalizeVersion(value string) string
- func ValidateVersion(value string) error
- func WaitForVersion(ctx context.Context, endpoints []string, targetVersion string, ...) error
- type ActiveVersion
- type Arbiter
- type Driver
- type Failure
- type HealthResponse
- type MacOSPlan
- type Phase
- type Result
- type State
- type Store
- func (store *Store) ActivePath() string
- func (store *Store) Complete(transaction Transaction, state State, failure *Failure, warnings []string) (Result, error)
- func (store *Store) CurrentResultPath() string
- func (store *Store) ReadActive() (ActiveVersion, error)
- func (store *Store) ReadResult(transactionID string) (Result, error)
- func (store *Store) ReadTransaction() (Transaction, error)
- func (store *Store) ResultPath(transactionID string) string
- func (store *Store) Root() string
- func (store *Store) TransactionPath() string
- func (store *Store) WriteActive(active ActiveVersion) error
- func (store *Store) WriteResult(result Result) error
- func (store *Store) WriteTransaction(transaction Transaction) error
- type Transaction
- type WindowsLayout
- func (layout WindowsLayout) BinDir() string
- func (layout WindowsLayout) CoreShim() string
- func (layout WindowsLayout) EnsureBase() error
- func (layout WindowsLayout) GenerationArbiter(version string) string
- func (layout WindowsLayout) GenerationCore(version string) string
- func (layout WindowsLayout) GenerationDir(version string) string
- func (layout WindowsLayout) GenerationSkills(version string) string
- func (layout WindowsLayout) GenerationTray(version string) string
- func (layout WindowsLayout) IsGenerationBinary(path string) bool
- func (layout WindowsLayout) TrayShim() string
- func (layout WindowsLayout) VersionsDir() string
- type WindowsPlan
Constants ¶
View Source
const ( StateStaged State = "staged" StateTrial State = "trial" StateCommitted State = "committed" StateRollingBack State = "rolling_back" StateRolledBack State = "rolled_back" StateFailed State = "failed" PhaseStage Phase = "stage" PhaseVerify Phase = "verify" PhaseActivate Phase = "activate" PhaseHealth Phase = "health" PhaseCommit Phase = "commit" PhaseRollback Phase = "rollback" )
View Source
const ( StableCoreShimName = "agentdock.exe" StableTrayShimName = "agentdock-tray.exe" GenerationCoreName = "agentdock-core.exe" GenerationTrayName = "agentdock-tray.exe" GenerationArbiterName = "agentdock-arbiter.exe" )
View Source
const SchemaVersion = 1
Variables ¶
This section is empty.
Functions ¶
func NewTransactionID ¶
func NormalizeVersion ¶
func ValidateVersion ¶
ValidateVersion keeps version strings safe as a single generation-directory name on all supported platforms. NormalizeVersion intentionally remains comparison-only; callers that persist or join a version into a path must validate it.
Types ¶
type ActiveVersion ¶
type ActiveVersion struct {
SchemaVersion int `json:"schema_version"`
ActiveVersion string `json:"active_version"`
FallbackVersion string `json:"fallback_version,omitempty"`
State State `json:"state"`
TransactionID string `json:"transaction_id,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
}
func (ActiveVersion) Validate ¶
func (active ActiveVersion) Validate() error
type Driver ¶
type Driver interface {
PrepareTrial(context.Context, Transaction) error
VerifyTrial(context.Context, Transaction) ([]string, error)
Commit(context.Context, Transaction) error
Rollback(context.Context, Transaction) error
}
type HealthResponse ¶
type MacOSPlan ¶
type MacOSPlan struct {
SourceArbiterPath string `json:"source_arbiter_path,omitempty"`
TargetAppPath string `json:"target_app_path"`
TrialAppPath string `json:"trial_app_path"`
HandoffPath string `json:"handoff_path,omitempty"`
ResultPath string `json:"result_path,omitempty"`
ServiceStatePath string `json:"service_state_path,omitempty"`
HealthURL string `json:"health_url,omitempty"`
AppWasRunning bool `json:"app_was_running,omitempty"`
CoreWasEnabled bool `json:"core_was_enabled,omitempty"`
TunnelEnabled bool `json:"tunnel_enabled,omitempty"`
BootstrapMigration bool `json:"bootstrap_migration,omitempty"`
}
type Result ¶
type Result struct {
SchemaVersion int `json:"schema_version"`
TransactionID string `json:"transaction_id"`
Platform string `json:"platform"`
SourceVersion string `json:"source_version"`
TargetVersion string `json:"target_version"`
ActiveVersion string `json:"active_version,omitempty"`
FallbackVersion string `json:"fallback_version,omitempty"`
State State `json:"state"`
CompletedAt time.Time `json:"completed_at"`
Failure *Failure `json:"failure,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) ActivePath ¶
func (*Store) CurrentResultPath ¶
func (*Store) ReadActive ¶
func (store *Store) ReadActive() (ActiveVersion, error)
func (*Store) ReadTransaction ¶
func (store *Store) ReadTransaction() (Transaction, error)
func (*Store) ResultPath ¶
func (*Store) TransactionPath ¶
func (*Store) WriteActive ¶
func (store *Store) WriteActive(active ActiveVersion) error
func (*Store) WriteResult ¶
func (*Store) WriteTransaction ¶
func (store *Store) WriteTransaction(transaction Transaction) error
type Transaction ¶
type Transaction struct {
SchemaVersion int `json:"schema_version"`
TransactionID string `json:"transaction_id"`
Platform string `json:"platform"`
SourceVersion string `json:"source_version"`
TargetVersion string `json:"target_version"`
ActiveVersion string `json:"active_version,omitempty"`
FallbackVersion string `json:"fallback_version,omitempty"`
State State `json:"state"`
Phase Phase `json:"phase"`
StartedAt time.Time `json:"started_at"`
UpdatedAt time.Time `json:"updated_at"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
Failure *Failure `json:"failure,omitempty"`
Warnings []string `json:"warnings,omitempty"`
Windows *WindowsPlan `json:"windows,omitempty"`
MacOS *MacOSPlan `json:"macos,omitempty"`
}
func NewTransaction ¶
func NewTransaction(platform, sourceVersion, targetVersion string) (Transaction, error)
func (Transaction) Validate ¶
func (transaction Transaction) Validate() error
type WindowsLayout ¶
type WindowsLayout struct {
Root string
}
func NewWindowsLayout ¶
func NewWindowsLayout(root string) (WindowsLayout, error)
func (WindowsLayout) BinDir ¶
func (layout WindowsLayout) BinDir() string
func (WindowsLayout) CoreShim ¶
func (layout WindowsLayout) CoreShim() string
func (WindowsLayout) EnsureBase ¶
func (layout WindowsLayout) EnsureBase() error
func (WindowsLayout) GenerationArbiter ¶
func (layout WindowsLayout) GenerationArbiter(version string) string
func (WindowsLayout) GenerationCore ¶
func (layout WindowsLayout) GenerationCore(version string) string
func (WindowsLayout) GenerationDir ¶
func (layout WindowsLayout) GenerationDir(version string) string
func (WindowsLayout) GenerationSkills ¶
func (layout WindowsLayout) GenerationSkills(version string) string
func (WindowsLayout) GenerationTray ¶
func (layout WindowsLayout) GenerationTray(version string) string
func (WindowsLayout) IsGenerationBinary ¶
func (layout WindowsLayout) IsGenerationBinary(path string) bool
func (WindowsLayout) TrayShim ¶
func (layout WindowsLayout) TrayShim() string
func (WindowsLayout) VersionsDir ¶
func (layout WindowsLayout) VersionsDir() string
type WindowsPlan ¶
type WindowsPlan struct {
InstallRoot string `json:"install_root"`
SourceGeneration string `json:"source_generation"`
TargetGeneration string `json:"target_generation"`
HealthURLs []string `json:"health_urls,omitempty"`
TaskName string `json:"task_name,omitempty"`
PrivilegeMode string `json:"privilege_mode,omitempty"`
CoreWasRunning bool `json:"core_was_running,omitempty"`
TrayWasRunning bool `json:"tray_was_running,omitempty"`
TunnelWasRunning bool `json:"tunnel_was_running,omitempty"`
ProgressUIHandoff bool `json:"progress_ui_handoff,omitempty"`
BootstrapMigration bool `json:"bootstrap_migration,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.