releasecontrol

package
v1.1.38 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: AGPL-3.0 Imports: 16 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 (
	CentralVersionUnavailableCode = "central_version_unavailable"
	CentralVersionInvalidCode     = "central_version_invalid"
)
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"
)

Variables

This section is empty.

Functions

func CanonicalServerVersion added in v1.1.3

func CanonicalServerVersion(field, value string) (string, error)

CanonicalServerVersion accepts canonical stable and development server versions while continuing to reject whitespace and other SemVer variants.

func CanonicalStableVersion added in v1.0.5

func CanonicalStableVersion(field, value string) (string, error)

CanonicalStableVersion rejects whitespace, prereleases, and build metadata. It is stricter than the historical client-report normalizer because central records that require stable versions are unambiguous release identifiers.

func CompareCanonicalServerVersions added in v1.1.3

func CompareCanonicalServerVersions(left, right string) (int, error)

CompareCanonicalServerVersions compares canonical server versions within the same release channel. Stable and development channels are intentionally not comparable because servers cannot upgrade across channels.

func CompareCanonicalStableVersions added in v1.0.5

func CompareCanonicalStableVersions(left, right string) (int, error)

CompareCanonicalStableVersions compares two canonical stable SemVer values.

func NormalizeClientVersion

func NormalizeClientVersion(value string) (string, error)

func NormalizeReleaseCatalogOrigin added in v1.1.6

func NormalizeReleaseCatalogOrigin(origin string) (string, error)

NormalizeReleaseCatalogOrigin validates one deployment-owned HTTPS origin. ProductCore receives only sources derived from this origin and cannot supply or override request destinations.

func ReleaseCatalogEndpoint added in v1.1.6

func ReleaseCatalogEndpoint(origin, channel string) (string, error)

ReleaseCatalogEndpoint derives one fixed appId=1 release channel from the validated deployment origin. Only code-owned channel names are accepted.

Types

type ActiveJob added in v1.0.5

type ActiveJob struct {
	JobID            string `json:"job_id"`
	Component        string `json:"component"`
	Status           string `json:"status"`
	CurrentVersion   string `json:"current_version,omitempty"`
	TargetVersion    string `json:"target_version,omitempty"`
	ServiceAvailable bool   `json:"service_available"`
}

ActiveJob is the public, token-free progress subset the updater returns to message-server status callers. It deliberately has no plan, image, digest, command, path, recovery point, or job bearer fields.

type AgentStatus added in v1.1.3

type AgentStatus struct {
	Available      bool     `json:"available"`
	CurrentVersion string   `json:"current_version,omitempty"`
	Reasons        []string `json:"reasons,omitempty"`
}

AgentStatus is the receipt-bound Agent runtime fact reported by the host updater. Central release discovery remains owned by message-server.

type ApplyRequest

type ApplyRequest struct {
	Component            ReleaseComponent `json:"component"`
	TargetVersion        string           `json:"target_version"`
	MinimumServerVersion string           `json:"minimum_server_version"`
	IdempotencyKey       string           `json:"idempotency_key"`
	Confirm              string           `json:"confirm"`
}

type CentralAgentVersion added in v1.1.3

type CentralAgentVersion struct {
	AppID      string
	ChannelID  string
	Version    string
	PreVersion string
}

CentralAgentVersion is the safe subset of the centrally owned Agent release record. PreVersion is the minimum compatible message-server version.

type CentralAgentVersionSource added in v1.1.3

type CentralAgentVersionSource interface {
	CurrentAgentVersion(context.Context) (CentralAgentVersion, error)
}

CentralAgentVersionSource retrieves only the fixed appId=1/agents record.

func NewCentralAgentVersionSource added in v1.1.3

func NewCentralAgentVersionSource(config CentralVersionSourceConfig) CentralAgentVersionSource

NewCentralAgentVersionSource always targets the fixed Dirextalk Agent channel. Neither callers nor ProductCore parameters can change its URL.

type CentralServerVersion added in v1.0.5

type CentralServerVersion struct {
	AppID       string
	ChannelID   string
	Version     string
	PreVersion  string
	UpdateNotes string
}

CentralServerVersion is the narrowly validated part of the centrally owned server release record. The message server intentionally does not use the release URL, image name, digest, or other infrastructure fields from this endpoint.

type CentralVersionError added in v1.0.5

type CentralVersionError struct {
	Code    string
	Message string
	// contains filtered or unexported fields
}

func AsCentralVersionError added in v1.0.5

func AsCentralVersionError(err error) (*CentralVersionError, bool)

func (*CentralVersionError) Error added in v1.0.5

func (e *CentralVersionError) Error() string

func (*CentralVersionError) Unwrap added in v1.0.5

func (e *CentralVersionError) Unwrap() error

type CentralVersionSource added in v1.0.5

type CentralVersionSource interface {
	CurrentServerVersion(context.Context) (CentralServerVersion, error)
}

CentralVersionSource retrieves the fixed appId=1/server release record. Its small interface lets ProductCore tests exercise compatibility gates without making network requests.

func NewCentralVersionSource added in v1.0.5

func NewCentralVersionSource(config CentralVersionSourceConfig) CentralVersionSource

NewCentralVersionSource always targets the configured Dirextalk admin endpoint. Callers cannot change this URL through ProductCore parameters.

type CentralVersionSourceConfig added in v1.0.5

type CentralVersionSourceConfig struct {
	HTTPClient *http.Client
	Origin     string
}

type Controller

type Controller interface {
	Status(context.Context) (Status, 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 JobTicket

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

type ReleaseComponent added in v1.1.3

type ReleaseComponent string
const (
	ReleaseComponentServer ReleaseComponent = "server"
	ReleaseComponentAgent  ReleaseComponent = "agent"
)

type Status added in v1.1.3

type Status struct {
	Available      bool           `json:"available"`
	UpdaterReady   bool           `json:"updater_ready"`
	CurrentVersion string         `json:"current_version"`
	DesiredState   string         `json:"desired_state"`
	ActiveJob      *ActiveJob     `json:"active_job,omitempty"`
	Watchdog       WatchdogStatus `json:"watchdog"`
	Agent          AgentStatus    `json:"agent"`
}

Status is the small release.v2 updater control response. It intentionally excludes release discovery, plans, and operations; central version lookup is performed by the message server at apply time instead.

type UnixControllerConfig

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

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