releasecontrol

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: AGPL-3.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
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"
)
View Source
const SupportedManifestVersion = 1
View Source
const SupportedReleaseIndexVersion = 1

Variables

This section is empty.

Functions

func NormalizeClientVersion

func NormalizeClientVersion(value string) (string, error)

Types

type ApplyRequest

type ApplyRequest struct {
	PlanToken      string `json:"plan_token"`
	IdempotencyKey string `json:"idempotency_key"`
	Confirm        string `json:"confirm"`
}

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

type ControllerError struct {
	Status  int
	Code    string
	Message string
}

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 IndexedRelease struct {
	Manifest       Manifest `json:"manifest"`
	ManifestDigest string   `json:"manifest_digest"`
}

type JobTicket

type JobTicket struct {
	JobID     string `json:"job_id"`
	JobToken  string `json:"job_token"`
	StatusURL string `json:"status_url"`
}

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 ValidateManifest(data []byte) (Manifest, error)

func (Manifest) AllowsUpgradeFrom

func (manifest Manifest) AllowsUpgradeFrom(currentVersion string) (bool, error)

func (Manifest) SupportsClient

func (manifest Manifest) SupportsClient(clientVersion string) (bool, error)

func (Manifest) ValidateUpgradeFrom

func (manifest Manifest) ValidateUpgradeFrom(currentVersion string) error

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 Operation

type Operation struct {
	Kind          string `json:"kind"`
	PlanToken     string `json:"plan_token"`
	TargetVersion string `json:"target_version,omitempty"`
	ExpiresAt     string `json:"expires_at,omitempty"`
	Confirm       string `json:"confirm,omitempty"`
}

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 StatusRequest struct {
	CurrentVersion             string `json:"current_version"`
	CurrentSchemaVersion       int    `json:"current_schema_version"`
	CurrentSchemaCompatVersion int    `json:"current_schema_compat_version"`
	ClientVersion              string `json:"client_version"`
}

type UnixControllerConfig

type UnixControllerConfig struct {
	SocketPath       string
	ControlTokenPath string
	Timeout          time.Duration
}

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"`
}

type UpgradeEdge

type UpgradeEdge struct {
	FromVersion      string   `json:"from_version"`
	FromImageDigests []string `json:"from_image_digests"`
	ToVersion        string   `json:"to_version"`
}

type WatchdogStatus

type WatchdogStatus struct {
	Status         string `json:"status"`
	Degraded       bool   `json:"degraded"`
	CooldownUntil  string `json:"cooldown_until,omitempty"`
	LastObservedAt string `json:"last_observed_at,omitempty"`
	ErrorCode      string `json:"error_code,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL