control

package
v0.1.12-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(ctx context.Context, dataDir string, handler Handler) error

Types

type Command

type Command struct {
	Action string `json:"action"`
}

type Handler

type Handler func(Command) Response

type Response

type Response struct {
	OK     bool    `json:"ok"`
	Error  string  `json:"error,omitempty"`
	Status *Status `json:"status,omitempty"`
}

func Send

func Send(ctx context.Context, dataDir string, command Command) (Response, error)

type Status

type Status struct {
	NodeID            string     `json:"node_id"`
	State             string     `json:"state"`
	GPU               string     `json:"gpu"`
	ModelID           string     `json:"model_id"`
	RuntimeHash       string     `json:"runtime_hash"`
	ModelHash         string     `json:"model_hash"`
	Schedule          string     `json:"schedule"`
	ScheduleState     string     `json:"schedule_state"`
	ThermalState      string     `json:"thermal_state"`
	Paused            bool       `json:"paused"`
	Draining          bool       `json:"draining"`
	TemperatureC      *int       `json:"temperature_c,omitempty"`
	PowerW            *int       `json:"power_w,omitempty"`
	SessionConnected  bool       `json:"session_connected"`
	SessionID         string     `json:"session_id,omitempty"`
	LastHeartbeatAt   *time.Time `json:"last_heartbeat_at,omitempty"`
	CredentialBackend string     `json:"credential_backend"`
	CoordinatorURL    string     `json:"coordinator_url"`
	HeartbeatInterval string     `json:"heartbeat_interval"`
	LastError         string     `json:"last_error,omitempty"`
}

Jump to

Keyboard shortcuts

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