dto

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BindMount

type BindMount struct {
	Source      string `json:"source"`      // Host path
	Destination string `json:"destination"` // Container path
	ReadOnly    bool   `json:"readonly,omitempty"`
}

type ContainerState

type ContainerState string
const (
	ContainerStart       ContainerState = "start"
	ContainerStartFailed ContainerState = "start_failed"
	ContainerStop        ContainerState = "stop"
	ContainerStopFailed  ContainerState = "stop_failed"
)

type ContainerStateResponse

type ContainerStateResponse struct {
	ContainerID   string  `json:"container_id"`
	CPUUsage      float64 `json:"cpu_usage"` // Important (percentage)
	CPUSystem     float64 `json:"cpu_system"`
	CPUUser       float64 `json:"cpu_user"`
	MemoryUsage   float64 `json:"mem_usage"`
	MemoryLimit   float64 `json:"mem_limit"`
	MemoryPercent float64 `json:"mem_percentage"` // Important (percentage)
}

type ContainerStatesResponse

type ContainerStatesResponse map[string]ContainerStateResponse

type CpuArch

type CpuArch uint8

CpuArch represents the type of CPU architecture

const (
	X86 CpuArch = iota
	X64
	Arm2
	Arm3
	Arm4T
	Arm5
	Arm6T2
	Arm6
	Arm7
	Arm7a
	Arm7r
	Arm7s
	Arm64
	Mips
	SuperH
	Ppc
	Ppc64
	Sparc
	M68k
	OtherArch
)

type CpuCFS

type CpuCFS struct {
	CpuQuota  int64  `json:"quota"`
	CpuPeriod uint64 `json:"period"`
}

type CreateContainerRequest

type CreateContainerRequest struct {
	Image       string         `json:"image"`
	MountVolume *[]MountVolume `json:"mount_volume,omitempty"`
	BindMounts  []BindMount    `json:"bind_mounts,omitempty"`
	Env         []string       `json:"env,omitempty"`
	Quotas      *Quotas        `json:"quotas,omitempty"`
	Entrypoint  *string        `json:"entrypoint,omitempty"`
	Args        []string       `json:"args,omitempty"`
	WorkingDir  *string        `json:"working_dir,omitempty"`
}

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
}

type FileDataResponse

type FileDataResponse struct {
	Data   string `json:"data"`
	EndPos int64  `json:"end_pos"`
}

type Image

type Image struct {
	Name      string    `json:"name"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type ImagesResponse

type ImagesResponse []Image

type LoadDeployment

type LoadDeployment struct {
	LoadName         string                  `json:"load_name"`
	DeploymentId     string                  `json:"deployment_id"`
	DeploymentStatus common.DeploymentStatus `json:"deployment_status"`
	Driver           string                  `json:"driver"`
	DriverConfig     any                     `json:"driver_config"`
	Metadata         any                     `json:"metadata,omitempty"`
}

type LoadInfo

type LoadInfo struct {
	Name         string `json:"name"`
	Node         string `json:"node"`
	Driver       string `json:"driver"`
	DriverConfig any    `json:"driver_config"`
}

type LoadsDeployments

type LoadsDeployments []LoadDeployment

type LoadsInfo

type LoadsInfo []LoadInfo

type MountVolume

type MountVolume struct {
	VolumeMountPoint string  `json:"volume_mount_point"`
	VolumeSize       *string `json:"volume_size,omitempty"`
}

type NetworkConfig

type NetworkConfig struct {
	Mode    string    `json:"mode,omitempty"`    // Network mode: "bridge" (default) or "host"
	Network string    `json:"network,omitempty"` // Network name (only used in bridge mode)
	IPMasq  bool      `json:"ip_masq,omitempty"`
	DNS     bool      `json:"dns,omitempty"`
	PortMap []Portmap `json:"portmap,omitempty"`
}

type NodeImagesMapResponse

type NodeImagesMapResponse []NodeImagesResponse

type NodeImagesResponse

type NodeImagesResponse struct {
	Node   string         `json:"node"`
	Images ImagesResponse `json:"images,omitempty"`
	Error  string         `json:"error,omitempty"`
}

type NodeResponse added in v0.1.2

type NodeResponse struct {
	State  NodeState         `json:"state"`
	Status common.NodeStatus `json:"status"`
}

type NodeState added in v0.1.2

type NodeState struct {
	NumCPU          int     `json:"ncpu"`
	UserCPU         uint64  `json:"cpu_user"`
	IdleCPU         uint64  `json:"cpu_idle"`
	SystemCPU       uint64  `json:"cpu_system"`
	TotalCPU        uint64  `json:"cpu_total"`
	UsageCPUPercent float64 `json:"cpu_usage_percentage"` // Important

	TotalMem       uint64  `json:"mem_total"`
	UsedMem        uint64  `json:"mem_used"`
	FreeMem        uint64  `json:"mem_free"`
	FreeMemPercent float64 `json:"mem_free_percentage"` // Important

	FreeStorage uint64 `json:"free_storage"`

	// Swap memory information
	SwapTotal uint64 `json:"swap_total"` // Total available swap memory in bytes
	SwapUsed  uint64 `json:"swap_used"`  // Total used swap memory in bytes
	SwapFree  uint64 `json:"swap_free"`  // Total free swap memory in bytes

	// CPU load average
	CpuLoadAvg float32 `json:"cpu_load_avg"` // CPU load average (from 0 to 1)

	// Process counts
	ProcTotalCount    uint32 `json:"proc_total_count"`    // Number of active processes
	ProcSleepingCount uint32 `json:"proc_sleeping_count"` // Number of sleeping processes
	ProcRunningCount  uint32 `json:"proc_running_count"`  // Number of running processes
	ProcZombieCount   uint32 `json:"proc_zombie_count"`   // Number of zombie processes
	ProcStoppedCount  uint32 `json:"proc_stopped_count"`  // Number of stopped processes
	ProcIdleCount     uint32 `json:"proc_idle_count"`     // Number of idle processes
	ProcThreadsCount  uint32 `json:"proc_threads_count"`  // Number of threads

	Containers []ContainerStateResponse `json:"containers,omitempty"`
}

type OsKind

type OsKind uint8

OsKind represents the type of operating system

const (
	WindowsOs OsKind = iota
	LinuxOs
	AndroidOs
	AppleOs
	UnixOs
	PosixOs
	OtherOs
)

type Portmap

type Portmap struct {
	HostPort      uint16 `json:"host_port"`
	ContainerPort uint16 `json:"container_port"`
	Protocol      string `json:"protocol"`
}

type ProvisionLoadInfo added in v0.1.2

type ProvisionLoadInfo struct {
	DeploymentId string `json:"deployment_id"`
}

type Quotas

type Quotas struct {
	MemLimit  *uint64 `json:"mem_limit,omitempty"` // Megabytes
	CpuCFS    *CpuCFS `json:"cpu_cfs,omitempty"`
	CpuShares *uint64 `json:"cpu_shares,omitempty"`
}

type RestartNodeRequest

type RestartNodeRequest struct {
	WallMessage string  `json:"wall_message"`
	Time        uint32  `json:"time"`
	NodeName    *string `json:"node_name,omitempty"`
}

type ShutdownNodeRequest

type ShutdownNodeRequest struct {
	WallMessage string  `json:"wall_message"`
	Time        uint32  `json:"time"`
	NodeName    *string `json:"node_name,omitempty"`
}

type StartupNodeRequest added in v0.1.2

type StartupNodeRequest struct {
	Node common.Node `json:"node"`
}

type SystemInfo

type SystemInfo struct {
	OsName            string  `json:"os_name"`              // Name of the OS, reported by the OS
	OsKind            OsKind  `json:"os_kind"`              // Kind of OS
	OsArch            CpuArch `json:"os_arch"`              // CPU architecture
	SysVendor         string  `json:"sys_vendor"`           // System vendor string
	NetDefaultGateway string  `json:"net_default_gateway"`  // Default network gateway
	NetHostName       string  `json:"net_host_name"`        // Network name of this host
	NetDomainName     string  `json:"net_domain_name"`      // Domain name of this host
	NetPrimaryDns     string  `json:"net_primary_dns"`      // Primary network DNS
	NetSecondaryDns   string  `json:"net_secondary_dns"`    // Secondary network DNS
	NetPrimaryIpAddr  string  `json:"net_primary_ip_addr"`  // Primary IP address
	NetMacAddress     string  `json:"net_mac_address"`      // Primary MAC address
	CpuModel          string  `json:"cpu_model"`            // CPU model string
	CpuStartTime      int64   `json:"cpu_start_time"`       // Time when the CPU got powered (Unix timestamp in nanoseconds)
	CpuTotalCores     uint32  `json:"cpu_total_cores"`      // Number of cores of the CPU
	CpuCoresPerSocket uint32  `json:"cpu_cores_per_socket"` // Number of cores per socket
	CpuTotalSockets   uint32  `json:"cpu_total_sockets"`    // Number of sockets
	CpuVendor         string  `json:"cpu_vendor"`           // CPU vendor string
	CpuMhz            uint32  `json:"cpu_mhz"`              // Maximum CPU frequency in Megahertz
	RamTotal          uint64  `json:"ram_total"`            // Total available RAM in bytes
}

SystemInfo contains static information about a computer

Jump to

Keyboard shortcuts

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