Help us shape the future of Go! Take the 2026 Go Developer Survey

system

package
v2.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: BSD-3-Clause Imports: 3 Imported by: 7

Documentation

Index

Constants

View Source
const (
	PruneContainerModeNone      PruneContainerMode = "none"
	PruneContainerModeStopped   PruneContainerMode = "stopped"
	PruneContainerModeOlderThan PruneContainerMode = "olderThan"

	PruneImageModeNone      PruneImageMode = "none"
	PruneImageModeDangling  PruneImageMode = "dangling"
	PruneImageModeAll       PruneImageMode = "all"
	PruneImageModeOlderThan PruneImageMode = "olderThan"

	PruneVolumeModeNone      PruneVolumeMode = "none"
	PruneVolumeModeAnonymous PruneVolumeMode = "anonymous"
	PruneVolumeModeAll       PruneVolumeMode = "all"

	PruneNetworkModeNone      PruneNetworkMode = "none"
	PruneNetworkModeUnused    PruneNetworkMode = "unused"
	PruneNetworkModeOlderThan PruneNetworkMode = "olderThan"

	PruneBuildCacheModeNone      PruneBuildCacheMode = "none"
	PruneBuildCacheModeUnused    PruneBuildCacheMode = "unused"
	PruneBuildCacheModeAll       PruneBuildCacheMode = "all"
	PruneBuildCacheModeOlderThan PruneBuildCacheMode = "olderThan"
)
View Source
const (
	WSKindProjectLogs    = "project_logs"
	WSKindContainerLogs  = "container_logs"
	WSKindContainerStats = "container_stats"
	WSKindContainerExec  = "container_exec"
	WSKindSystemStats    = "system_stats"
	WSKindServiceLogs    = "service_logs"
	WSKindDiagnostics    = "diagnostics"
)

WebSocket connection kind constants.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActorDiagnostics added in v2.15.0

type ActorDiagnostics struct {
	EnvironmentID   string `json:"environmentId"`
	EnvironmentName string `json:"environmentName"`
	// Error is set when the environment's actor diagnostics could not be collected.
	Error      string          `json:"error,omitempty"`
	Ready      bool            `json:"ready"`
	Hosts      []ActorHostInfo `json:"hosts"`
	ActorTypes []ActorTypeInfo `json:"actorTypes"`
	Runs       map[string]int  `json:"runs"`
	CheckedAt  time.Time       `json:"checkedAt"`
}

ActorDiagnostics describes the Francis actor host of one environment.

type ActorHostInfo added in v2.15.0

type ActorHostInfo struct {
	HostID          string    `json:"hostId"`
	Address         string    `json:"address"`
	LastHealthCheck time.Time `json:"lastHealthCheck"`
}

ActorHostInfo is a registered Francis host.

type ActorInstance added in v2.15.0

type ActorInstance struct {
	ActorID string `json:"actorId"`
	// Name is Arcane's display name for the actor, when known.
	Name        string    `json:"name,omitempty"`
	HostID      string    `json:"hostId"`
	ActivatedAt time.Time `json:"activatedAt"`
}

ActorInstance is an activated actor.

type ActorJobFailure added in v2.15.0

type ActorJobFailure struct {
	JobID     string    `json:"jobId"`
	ActorID   string    `json:"actorId"`
	Name      string    `json:"name,omitempty"`
	Method    string    `json:"method"`
	Attempts  int       `json:"attempts"`
	LastError string    `json:"lastError,omitempty"`
	FailedAt  time.Time `json:"failedAt"`
}

ActorJobFailure is a dead-lettered actor job.

type ActorTypeInfo added in v2.15.0

type ActorTypeInfo struct {
	ActorType string `json:"actorType"`
	// ConcurrencyLimit caps concurrent invocations per actor; 0 is unlimited.
	ConcurrencyLimit int               `json:"concurrencyLimit"`
	ActiveActors     int               `json:"activeActors"`
	StoredStates     int               `json:"storedStates"`
	PendingAlarms    int               `json:"pendingAlarms"`
	PendingJobs      int               `json:"pendingJobs"`
	LeasedAlarms     int               `json:"leasedAlarms"`
	CompletedJobs    int               `json:"completedJobs"`
	DeadJobs         int               `json:"deadJobs"`
	NextAlarmAt      time.Time         `json:"nextAlarmAt,omitzero"`
	Instances        []ActorInstance   `json:"instances"`
	RecentFailures   []ActorJobFailure `json:"recentFailures"`
}

ActorTypeInfo holds per actor type activation, alarm, and job details.

type ConvertDockerRunRequest

type ConvertDockerRunRequest struct {
	DockerRunCommand string `json:"dockerRunCommand" binding:"required"`
}

type ConvertDockerRunResponse

type ConvertDockerRunResponse struct {
	Success       bool   `json:"success"`
	DockerCompose string `json:"dockerCompose"`
	EnvVars       string `json:"envVars"`
	ServiceName   string `json:"serviceName"`
}

type Diagnostics

type Diagnostics struct {
	// Timestamp is when the snapshot was taken.
	//
	// Required: true
	Timestamp time.Time `json:"timestamp"`
	// Runtime holds Go runtime and scheduler counters.
	//
	// Required: true
	Runtime RuntimeInfo `json:"runtime"`
	// Memory holds a subset of runtime.MemStats.
	//
	// Required: true
	Memory MemoryInfo `json:"memory"`
	// GC holds garbage-collector statistics.
	//
	// Required: true
	GC GCInfo `json:"gc"`
	// WebSocket holds active WebSocket connection metrics.
	//
	// Required: true
	WebSocket WebSocketDiagnostics `json:"websocket"`
}

Diagnostics is a point-in-time snapshot of the Go runtime, garbage collector, and active WebSocket connections. It is returned by the diagnostics REST endpoint and pushed over the live diagnostics WebSocket stream.

type DiagnosticsCommand added in v2.15.0

type DiagnosticsCommand struct {
	ID string `json:"id"`
	// Type is refresh, dump, leakScan, or profile.
	Type    string `json:"type"`
	Name    string `json:"name,omitempty"`
	Seconds int    `json:"seconds,omitempty"`
}

DiagnosticsCommand is a client request sent over the diagnostics stream.

type DiagnosticsMessage added in v2.15.0

type DiagnosticsMessage struct {
	// Type is snapshot or result.
	Type       string               `json:"type"`
	ID         string               `json:"id,omitempty"`
	Snapshot   *Diagnostics         `json:"snapshot,omitempty"`
	LeakReport *GoroutineLeakReport `json:"leakReport,omitempty"`
	Text       string               `json:"text,omitempty"`
	Data       []byte               `json:"data,omitempty"`
	Error      string               `json:"error,omitempty"`
}

DiagnosticsMessage is a snapshot push or command result on the diagnostics stream.

type DockerComposeConfig

type DockerComposeConfig struct {
	Services map[string]DockerComposeService `yaml:"services" json:"services"`
}

type DockerComposeDeploy

type DockerComposeDeploy struct {
	Resources *DockerComposeResources `yaml:"resources,omitempty" json:"resources,omitempty"`
}

type DockerComposeHealthcheck

type DockerComposeHealthcheck struct {
	Test string `yaml:"test" json:"test"`
}

type DockerComposeResourceLimits

type DockerComposeResourceLimits struct {
	Memory string `yaml:"memory,omitempty" json:"memory,omitempty"`
	CPUs   string `yaml:"cpus,omitempty" json:"cpus,omitempty"`
}

type DockerComposeResources

type DockerComposeResources struct {
	Limits *DockerComposeResourceLimits `yaml:"limits,omitempty" json:"limits,omitempty"`
}

type DockerComposeService

type DockerComposeService struct {
	Image         string                    `yaml:"image" json:"image"`
	ContainerName string                    `yaml:"container_name,omitempty" json:"container_name,omitempty"`
	Ports         []string                  `yaml:"ports,omitempty" json:"ports,omitempty"`
	Volumes       []string                  `yaml:"volumes,omitempty" json:"volumes,omitempty"`
	Environment   []string                  `yaml:"environment,omitempty" json:"environment,omitempty"`
	Networks      []string                  `yaml:"networks,omitempty" json:"networks,omitempty"`
	Restart       string                    `yaml:"restart,omitempty" json:"restart,omitempty"`
	WorkingDir    string                    `yaml:"working_dir,omitempty" json:"working_dir,omitempty"`
	User          string                    `yaml:"user,omitempty" json:"user,omitempty"`
	Entrypoint    string                    `yaml:"entrypoint,omitempty" json:"entrypoint,omitempty"`
	Command       string                    `yaml:"command,omitempty" json:"command,omitempty"`
	StdinOpen     bool                      `yaml:"stdin_open,omitempty" json:"stdin_open,omitempty"`
	TTY           bool                      `yaml:"tty,omitempty" json:"tty,omitempty"`
	Privileged    bool                      `yaml:"privileged,omitempty" json:"privileged,omitempty"`
	Labels        []string                  `yaml:"labels,omitempty" json:"labels,omitempty"`
	Healthcheck   *DockerComposeHealthcheck `yaml:"healthcheck,omitempty" json:"healthcheck,omitempty"`
	Deploy        *DockerComposeDeploy      `yaml:"deploy,omitempty" json:"deploy,omitempty"`
}

type DockerRunCommand

type DockerRunCommand struct {
	Image       string   `json:"image"`
	Name        string   `json:"name,omitempty"`
	Ports       []string `json:"ports,omitempty"`
	Volumes     []string `json:"volumes,omitempty"`
	Environment []string `json:"environment,omitempty"`
	Networks    []string `json:"networks,omitempty"`
	Restart     string   `json:"restart,omitempty"`
	Workdir     string   `json:"workdir,omitempty"`
	User        string   `json:"user,omitempty"`
	Entrypoint  string   `json:"entrypoint,omitempty"`
	Command     string   `json:"command,omitempty"`
	Detached    bool     `json:"detached,omitempty"`
	Interactive bool     `json:"interactive,omitempty"`
	TTY         bool     `json:"tty,omitempty"`
	Remove      bool     `json:"remove,omitempty"`
	Privileged  bool     `json:"privileged,omitempty"`
	Labels      []string `json:"labels,omitempty"`
	HealthCheck string   `json:"healthCheck,omitempty"`
	MemoryLimit string   `json:"memoryLimit,omitempty"`
	CPULimit    string   `json:"cpuLimit,omitempty"`
}

type GCInfo

type GCInfo struct {
	// LastGC is the time of the most recent collection.
	LastGC time.Time `json:"lastGc"`
	// NumGC is the total number of completed GC cycles.
	NumGC int64 `json:"numGc"`
	// PauseTotalNs is the cumulative stop-the-world pause time in nanoseconds.
	PauseTotalNs int64 `json:"pauseTotalNs"`
	// RecentPausesNs lists the most recent GC pause durations (ns), newest first.
	RecentPausesNs []int64 `json:"recentPausesNs"`
}

GCInfo holds garbage-collector statistics from runtime/debug.ReadGCStats.

type GPUStats

type GPUStats struct {
	// Name is the GPU model or identifier.
	//
	// Required: true
	Name string `json:"name"`
	// Index is the zero-based GPU index.
	//
	// Required: true
	Index int `json:"index"`
	// MemoryUsed is the GPU memory currently used, in bytes.
	//
	// Required: true
	MemoryUsed float64 `json:"memoryUsed"`
	// MemoryTotal is the total GPU memory available, in bytes.
	//
	// Required: true
	MemoryTotal float64 `json:"memoryTotal"`
}

GPUStats represents resource statistics for a single GPU.

type GoroutineLeakReport added in v2.9.0

type GoroutineLeakReport struct {
	Count     int       `json:"count"`
	Profile   string    `json:"profile"`
	ScannedAt time.Time `json:"scannedAt"`
}

GoroutineLeakReport is the result of an on-demand goroutine leak scan. The scan triggers a leak-detection GC cycle, then writes the goroutineleak pprof profile as debug=1 text (leaked stacks only).

type HealthResponse

type HealthResponse struct {
	// Status indicates the health status (e.g., "UP", "DOWN").
	//
	// Required: true
	Status string `json:"status"`
}

HealthResponse contains the health status of the API.

type MemoryInfo

type MemoryInfo struct {
	Alloc         uint64  `json:"alloc"`
	TotalAlloc    uint64  `json:"totalAlloc"`
	Sys           uint64  `json:"sys"`
	HeapAlloc     uint64  `json:"heapAlloc"`
	HeapSys       uint64  `json:"heapSys"`
	HeapInuse     uint64  `json:"heapInuse"`
	HeapIdle      uint64  `json:"heapIdle"`
	HeapReleased  uint64  `json:"heapReleased"`
	HeapObjects   uint64  `json:"heapObjects"`
	StackInuse    uint64  `json:"stackInuse"`
	StackSys      uint64  `json:"stackSys"`
	MSpanInuse    uint64  `json:"mspanInuse"`
	MCacheInuse   uint64  `json:"mcacheInuse"`
	NextGC        uint64  `json:"nextGc"`
	NumGC         uint32  `json:"numGc"`
	NumForcedGC   uint32  `json:"numForcedGc"`
	GCCPUFraction float64 `json:"gcCpuFraction"`
}

MemoryInfo is the subset of runtime.MemStats surfaced in diagnostics. All byte counts are raw bytes.

type PruneAllRequest

type PruneAllRequest struct {
	Containers *PruneContainersOptions `json:"containers,omitempty"`
	Images     *PruneImagesOptions     `json:"images,omitempty"`
	Volumes    *PruneVolumesOptions    `json:"volumes,omitempty"`
	Networks   *PruneNetworksOptions   `json:"networks,omitempty"`
	BuildCache *PruneBuildCacheOptions `json:"buildCache,omitempty"`
}

PruneAllRequest is used to request pruning of Docker system resources.

func (*PruneAllRequest) UnmarshalJSON

func (r *PruneAllRequest) UnmarshalJSON(data []byte) error

type PruneAllResult

type PruneAllResult struct {
	// ContainersPruned is a list of container IDs that were pruned.
	//
	// Required: false
	ContainersPruned []string `json:"containersPruned,omitempty"`

	// ImagesDeleted is a list of image IDs that were deleted.
	//
	// Required: false
	ImagesDeleted []string `json:"imagesDeleted,omitempty"`

	// VolumesDeleted is a list of volume IDs that were deleted.
	//
	// Required: false
	VolumesDeleted []string `json:"volumesDeleted,omitempty"`

	// NetworksDeleted is a list of network IDs that were deleted.
	//
	// Required: false
	NetworksDeleted []string `json:"networksDeleted,omitempty"`

	// SpaceReclaimed is the amount of space reclaimed in bytes.
	//
	// Required: true
	SpaceReclaimed uint64 `json:"spaceReclaimed"`

	// ContainerSpaceReclaimed is the amount of space reclaimed from containers in bytes.
	//
	// Required: false
	ContainerSpaceReclaimed uint64 `json:"containerSpaceReclaimed,omitempty"`

	// ImageSpaceReclaimed is the amount of space reclaimed from images in bytes.
	//
	// Required: false
	ImageSpaceReclaimed uint64 `json:"imageSpaceReclaimed,omitempty"`

	// VolumeSpaceReclaimed is the amount of space reclaimed from volumes in bytes.
	//
	// Required: false
	VolumeSpaceReclaimed uint64 `json:"volumeSpaceReclaimed,omitempty"`

	// BuildCacheSpaceReclaimed is the amount of space reclaimed from build cache in bytes.
	//
	// Required: false
	BuildCacheSpaceReclaimed uint64 `json:"buildCacheSpaceReclaimed,omitempty"`

	// Success indicates if the prune operation was successful.
	//
	// Required: true
	Success bool `json:"success"`

	// Errors is a list of any errors encountered during the prune operation.
	//
	// Required: false
	Errors []string `json:"errors,omitempty"`

	// ActivityID is the background activity that tracked this prune operation.
	//
	// Required: false
	ActivityID *string `json:"activityId,omitempty"`
}

PruneAllResult is the result of a prune operation on Docker system resources.

type PruneBuildCacheMode

type PruneBuildCacheMode string

type PruneBuildCacheOptions

type PruneBuildCacheOptions struct {
	Mode  PruneBuildCacheMode `json:"mode"`
	Until string              `json:"until,omitempty"`
}

type PruneContainerMode

type PruneContainerMode string

type PruneContainersOptions

type PruneContainersOptions struct {
	Mode  PruneContainerMode `json:"mode"`
	Until string             `json:"until,omitempty"`
}

type PruneImageMode

type PruneImageMode string

type PruneImagesOptions

type PruneImagesOptions struct {
	Mode  PruneImageMode `json:"mode"`
	Until string         `json:"until,omitempty"`
}

type PruneNetworkMode

type PruneNetworkMode string

type PruneNetworksOptions

type PruneNetworksOptions struct {
	Mode  PruneNetworkMode `json:"mode"`
	Until string           `json:"until,omitempty"`
}

type PruneVolumeMode

type PruneVolumeMode string

type PruneVolumesOptions

type PruneVolumesOptions struct {
	Mode PruneVolumeMode `json:"mode"`
}

type RuntimeInfo

type RuntimeInfo struct {
	Goroutines         int       `json:"goroutines"`
	WSWorkerGoroutines int       `json:"wsWorkerGoroutines"`
	LeakedGoroutines   int       `json:"leakedGoroutines"`
	GOMAXPROCS         int       `json:"gomaxprocs"`
	NumCPU             int       `json:"numCpu"`
	GoVersion          string    `json:"goVersion"`
	OS                 string    `json:"os"`
	Arch               string    `json:"arch"`
	NumCgoCall         int64     `json:"numCgoCall"`
	UptimeSeconds      int64     `json:"uptimeSeconds"`
	LeakScannedAt      time.Time `json:"leakScannedAt,omitzero"`
}

RuntimeInfo describes the Go runtime, build, and scheduler state.

type SystemStats

type SystemStats struct {
	// CPUUsage is the total CPU usage percentage.
	//
	// Required: true
	CPUUsage float64 `json:"cpuUsage"`
	// MemoryUsage is the used system memory, in bytes.
	//
	// Required: true
	MemoryUsage uint64 `json:"memoryUsage"`
	// MemoryTotal is the total system memory, in bytes.
	//
	// Required: true
	MemoryTotal uint64 `json:"memoryTotal"`
	// DiskUsage is the used disk space, in bytes.
	DiskUsage uint64 `json:"diskUsage,omitempty"`
	// DiskTotal is the total disk space, in bytes.
	DiskTotal uint64 `json:"diskTotal,omitempty"`
	// CPUCount is the number of CPUs available to the system.
	//
	// Required: true
	CPUCount int `json:"cpuCount"`
	// Architecture is the CPU architecture (e.g., amd64).
	//
	// Required: true
	Architecture string `json:"architecture"`
	// Platform is the operating system platform (e.g., linux).
	//
	// Required: true
	Platform string `json:"platform"`
	// Hostname is the system hostname.
	Hostname string `json:"hostname,omitempty"`
	// GPUCount is the number of GPUs detected.
	//
	// Required: true
	GPUCount int `json:"gpuCount"`
	// GPUs contains per-GPU resource statistics.
	GPUs []GPUStats `json:"gpus,omitempty"`
}

SystemStats represents system resource statistics for WebSocket streaming.

type WebSocketConnectionInfo

type WebSocketConnectionInfo struct {
	// ID is the unique identifier for the connection.
	//
	// Required: true
	ID string `json:"id"`
	// Kind is the type of WebSocket connection (e.g. project_logs, container_stats).
	//
	// Required: true
	Kind string `json:"kind"`
	// EnvID is the environment the connection belongs to.
	EnvID string `json:"envId,omitempty"`
	// ResourceID is the ID of the resource being streamed (container, project, etc.).
	ResourceID string `json:"resourceId,omitempty"`
	// ClientIP is the remote address of the client.
	ClientIP string `json:"clientIp,omitempty"`
	// UserID is the authenticated user who opened the connection.
	UserID string `json:"userId,omitempty"`
	// UserAgent is the HTTP User-Agent header from the client.
	UserAgent string `json:"userAgent,omitempty"`
	// StartedAt is when the connection was established.
	//
	// Required: true
	StartedAt time.Time `json:"startedAt"`
}

WebSocketConnectionInfo describes a single active WebSocket connection.

type WebSocketDiagnostics

type WebSocketDiagnostics struct {
	Snapshot    WebSocketMetricsSnapshot  `json:"snapshot"`
	Connections []WebSocketConnectionInfo `json:"connections"`
}

WebSocketDiagnostics aggregates the active WebSocket connection counts and the list of currently-tracked connections.

type WebSocketMetricsSnapshot

type WebSocketMetricsSnapshot struct {
	// ProjectLogsActive is the number of active project-log streams.
	ProjectLogsActive int64 `json:"projectLogsActive"`
	// ContainerLogsActive is the number of active container-log streams.
	ContainerLogsActive int64 `json:"containerLogsActive"`
	// ContainerStats is the number of active container-stats streams.
	ContainerStats int64 `json:"containerStats"`
	// ContainerExec is the number of active container-exec sessions.
	ContainerExec int64 `json:"containerExec"`
	// SystemStats is the number of active system-stats streams.
	SystemStats int64 `json:"systemStats"`
	// DiagnosticsActive is the number of active diagnostics streams.
	DiagnosticsActive int64 `json:"diagnosticsActive"`
	// ServiceLogsActive is the number of active swarm service-log streams.
	ServiceLogsActive int64 `json:"serviceLogsActive"`
}

WebSocketMetricsSnapshot is a point-in-time copy of active WebSocket connection counts, broken down by kind.

Jump to

Keyboard shortcuts

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