Documentation
¶
Index ¶
- Constants
- func NormalizeClientVersion(value string) (string, error)
- type ApplyRequest
- type Controller
- type ControllerError
- type DesiredState
- type IndexedRelease
- type JobTicket
- type Manifest
- type Operation
- type ReleaseIndex
- type StatusRequest
- type UnixControllerConfig
- type UpdaterStatus
- type UpgradeEdge
- type WatchdogStatus
Constants ¶
const ( DefaultUpdaterSocketPath = "/run/dirextalk-updater/http.sock" DefaultUpdaterControlTokenPath = "/etc/dirextalk-updater/control-token" ControlTokenHeader = "X-Dirextalk-Control-Token" ControlStatusPath = "/_dirextalk/updater/v1/control/status" ControlJobsPath = "/_dirextalk/updater/v1/control/jobs" ControlDesiredStatePath = "/_dirextalk/updater/v1/control/desired-state" ApplyConfirmation = "apply_release_change" )
const SupportedManifestVersion = 1
const SupportedReleaseIndexVersion = 1
Variables ¶
This section is empty.
Functions ¶
func NormalizeClientVersion ¶
Types ¶
type ApplyRequest ¶
type Controller ¶
type Controller interface {
Status(context.Context, StatusRequest) (UpdaterStatus, error)
Apply(context.Context, ApplyRequest) (JobTicket, error)
SetDesiredState(context.Context, DesiredState) error
}
func NewUnixController ¶
func NewUnixController(config UnixControllerConfig) Controller
type ControllerError ¶
func AsControllerError ¶
func AsControllerError(err error) (*ControllerError, bool)
func (*ControllerError) Error ¶
func (e *ControllerError) Error() string
type DesiredState ¶
type DesiredState string
const ( DesiredStateRunning DesiredState = "running" DesiredStateUpgrading DesiredState = "upgrading" DesiredStateMaintenance DesiredState = "maintenance" DesiredStateDeprovisioned DesiredState = "deprovisioned" )
type IndexedRelease ¶
type Manifest ¶
type Manifest struct {
ManifestVersion int `json:"manifest_version"`
Version string `json:"version"`
Image string `json:"image"`
ImageDigest string `json:"image_digest"`
BaselineResetFromVersion string `json:"baseline_reset_from_version,omitempty"`
UpgradeFrom []string `json:"upgrade_from"`
SchemaVersion int `json:"schema_version"`
SchemaCompatVersion int `json:"schema_compat_version"`
MinimumClientVersion string `json:"minimum_client_version"`
MaximumClientVersionExclusive string `json:"maximum_client_version_exclusive"`
BackupRequired bool `json:"backup_required"`
RollbackSupported bool `json:"rollback_supported"`
RollbackMode string `json:"rollback_mode"`
ReleaseNotesURL string `json:"release_notes_url"`
}
func ValidateManifest ¶
func (Manifest) AllowsUpgradeFrom ¶
func (Manifest) SupportsClient ¶
func (Manifest) ValidateUpgradeFrom ¶
ValidateUpgradeFrom verifies one explicit source-to-target release edge. Release indexes call this for every edge instead of inferring compatibility from version ordering alone.
type ReleaseIndex ¶
type ReleaseIndex struct {
ReleaseIndexVersion int `json:"release_index_version"`
LatestVersion string `json:"latest_version"`
Releases []IndexedRelease `json:"releases"`
UpgradeEdges []UpgradeEdge `json:"upgrade_edges"`
}
func ValidateReleaseArtifacts ¶
func ValidateReleaseArtifacts(manifestData, manifestChecksum, indexData, indexChecksum []byte) (ReleaseIndex, error)
ValidateReleaseArtifacts verifies the exact bytes published as the four immutable GitHub Release assets. It intentionally does not trim input.
func ValidateReleaseIndex ¶
func ValidateReleaseIndex(data []byte) (ReleaseIndex, error)
type StatusRequest ¶
type UnixControllerConfig ¶
type UpdaterStatus ¶
type UpdaterStatus struct {
Available bool `json:"available"`
ReleaseAvailable bool `json:"release_available"`
UpdateAvailable bool `json:"update_available"`
DiscoveryStatus string `json:"discovery_status"`
CheckedAt string `json:"checked_at,omitempty"`
CurrentVersion string `json:"current_version"`
LatestVersion string `json:"latest_version,omitempty"`
ClientVersion string `json:"client_version,omitempty"`
Compatibility string `json:"compatibility"`
Reasons []string `json:"reasons"`
ReleaseNotesURL string `json:"release_notes_url,omitempty"`
Operations []Operation `json:"operations"`
Watchdog WatchdogStatus `json:"watchdog"`
}