sys

package
v0.6.13 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TypeID_SYS_PING is a lightweight, side-effect-free health check RPC for Env App.
	//
	// NOTE: The type_id must match Env App: internal/envapp/ui_src/src/ui/protocol/redeven_v1/typeIds.ts.
	TypeID_SYS_PING uint32 = 4001

	// TypeID_SYS_UPGRADE triggers an in-place self-upgrade (download latest + restart).
	//
	// NOTE: The type_id must match Env App: internal/envapp/ui_src/src/ui/protocol/redeven_v1/typeIds.ts.
	TypeID_SYS_UPGRADE uint32 = 4002

	// TypeID_SYS_RESTART restarts the runtime process (best-effort).
	//
	// NOTE: The type_id must match Env App: internal/envapp/ui_src/src/ui/protocol/redeven_v1/typeIds.ts.
	TypeID_SYS_RESTART uint32 = 4003
)
View Source
const (
	MaintenanceKindUpgrade = "upgrade"
	MaintenanceKindRestart = "restart"

	MaintenanceStateRunning   = "running"
	MaintenanceStateSucceeded = "succeeded"
	MaintenanceStateFailed    = "failed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MaintenanceSnapshot

type MaintenanceSnapshot struct {
	Kind                       string `json:"kind,omitempty"`
	State                      string `json:"state,omitempty"`
	TargetVersion              string `json:"target_version,omitempty"`
	PreviousVersion            string `json:"previous_version,omitempty"`
	ObservedVersion            string `json:"observed_version,omitempty"`
	PreviousProcessStartedAtMs int64  `json:"previous_process_started_at_ms,omitempty"`
	ObservedProcessStartedAtMs int64  `json:"observed_process_started_at_ms,omitempty"`
	PreviousRuntimeInstanceID  string `json:"previous_runtime_instance_id,omitempty"`
	ObservedRuntimeInstanceID  string `json:"observed_runtime_instance_id,omitempty"`
	InstallDir                 string `json:"install_dir,omitempty"`
	ExePath                    string `json:"exe_path,omitempty"`
	Message                    string `json:"message,omitempty"`
	ErrorCode                  string `json:"error_code,omitempty"`
	StartedAtMs                int64  `json:"started_at_ms,omitempty"`
	UpdatedAtMs                int64  `json:"updated_at_ms,omitempty"`
	CompletedAtMs              int64  `json:"completed_at_ms,omitempty"`
}

type MaintenanceSnapshotProvider

type MaintenanceSnapshotProvider interface {
	CurrentMaintenanceSnapshot() *MaintenanceSnapshot
}

type Options

type Options struct {
	AgentInstanceID    string
	ProcessStartedAtMs int64
	Version            string
	Commit             string
	BuildTime          string
	Upgrader           Upgrader
	Restarter          Restarter
	Maintenance        MaintenanceSnapshotProvider
	RuntimeService     RuntimeServiceSnapshotProvider
}

type RestartRequest

type RestartRequest struct{}

type RestartResponse

type RestartResponse struct {
	OK      bool   `json:"ok"`
	Message string `json:"message,omitempty"`
}

type Restarter

type Restarter interface {
	StartRestart(ctx context.Context, meta *session.Meta, req *RestartRequest) (*RestartResponse, error)
}

type RuntimeServiceSnapshot

type RuntimeServiceSnapshot = runtimeservice.Snapshot

type RuntimeServiceSnapshotProvider

type RuntimeServiceSnapshotProvider interface {
	CurrentRuntimeServiceSnapshot() RuntimeServiceSnapshot
}

type RuntimeServiceWorkload

type RuntimeServiceWorkload = runtimeservice.Workload

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(opts Options) *Service

func (*Service) Register

func (s *Service) Register(r *rpc.Router, meta *session.Meta)

func (*Service) RegisterWithAccessGate

func (s *Service) RegisterWithAccessGate(r *rpc.Router, meta *session.Meta, gate *accessgate.Gate)

type UpgradeRequest

type UpgradeRequest struct {
	DryRun        *bool  `json:"dry_run,omitempty"`
	TargetVersion string `json:"target_version,omitempty"`
}

type UpgradeResponse

type UpgradeResponse struct {
	OK      bool   `json:"ok"`
	Message string `json:"message,omitempty"`
}

type Upgrader

type Upgrader interface {
	StartUpgrade(ctx context.Context, meta *session.Meta, req *UpgradeRequest) (*UpgradeResponse, error)
}

Jump to

Keyboard shortcuts

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