types

package
v1.0.0-beta.34 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clinfo

type Clinfo struct {
	Devices []struct {
		Online []struct {
			ClDeviceName              string `json:"CL_DEVICE_NAME"`
			ClDeviceVendor            string `json:"CL_DEVICE_VENDOR"`
			ClDeviceVendorID          int    `json:"CL_DEVICE_VENDOR_ID"`
			ClDeviceVersion           string `json:"CL_DEVICE_VERSION"`
			ClDevicePciBusInfoKhr     string `json:"CL_DEVICE_PCI_BUS_INFO_KHR"`
			ClDeviceGlobalMemSize     uint64 `json:"CL_DEVICE_GLOBAL_MEM_SIZE"`
			ClDeviceMaxMemAllocSize   int64  `json:"CL_DEVICE_MAX_MEM_ALLOC_SIZE"`
			ClDeviceHostUnifiedMemory bool   `json:"CL_DEVICE_HOST_UNIFIED_MEMORY"`
		} `json:"online"`
	} `json:"devices"`
}

type CpuInfo

type CpuInfo struct {
	Architecture string `json:"architecture" yaml:"architecture"`

	// amd64
	ManufacturerId string   `json:"manufacturer-id,omitempty" yaml:"manufacturer-id,omitempty"`
	Flags          []string `json:"flags,omitempty" yaml:"flags,omitempty"`

	// arm64
	ImplementerId HexInt   `json:"implementer-id,omitempty" yaml:"implementer-id,omitempty"`
	PartNumber    HexInt   `json:"part-number,omitempty" yaml:"part-number,omitempty"`
	Features      []string `json:"features,omitempty" yaml:"features,omitempty"`
}

type DirStats

type DirStats struct {
	Total uint64 `json:"total" yaml:"total"`
	Avail uint64 `json:"avail" yaml:"avail"`
}

type HexInt

type HexInt int

HexInt Custom type to handle hex values

func (HexInt) MarshalJSON

func (hi HexInt) MarshalJSON() ([]byte, error)

func (HexInt) MarshalYAML

func (hi HexInt) MarshalYAML() (interface{}, error)

func (*HexInt) UnmarshalJSON

func (hi *HexInt) UnmarshalJSON(data []byte) error

func (*HexInt) UnmarshalYAML

func (hi *HexInt) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML parses a hex string into an int

type HwInfo

type HwInfo struct {
	Cpus       []CpuInfo           `json:"cpus,omitempty" yaml:"cpus,omitempty"`
	Memory     MemoryInfo          `json:"memory,omitempty" yaml:"memory,omitempty"`
	Disk       map[string]DirStats `json:"disk,omitempty" yaml:"disk,omitempty"`
	PciDevices []PciDevice         `json:"pci,omitempty" yaml:"pci"`
}

type MemoryInfo

type MemoryInfo struct {
	TotalRam  uint64 `json:"total-ram" yaml:"total-ram"`
	TotalSwap uint64 `json:"total-swap" yaml:"total-swap"`
}

type PciDevice

type PciDevice struct {
	Score                int     `json:"score,omitempty" yaml:"score,omitempty"`
	Slot                 string  `json:"slot" yaml:"slot"`
	BusNumber            HexInt  `json:"bus-number" yaml:"bus-number"`
	DeviceClass          HexInt  `json:"device-class" yaml:"device-class"`
	ProgrammingInterface *uint8  `json:"programming-interface,omitempty" yaml:"programming-interface,omitempty"`
	VendorId             HexInt  `json:"vendor-id" yaml:"vendor-id"`
	DeviceId             HexInt  `json:"device-id" yaml:"device-id"`
	SubvendorId          *HexInt `json:"subvendor-id,omitempty" yaml:"subvendor-id,omitempty"`
	SubdeviceId          *HexInt `json:"subdevice-id,omitempty" yaml:"subdevice-id,omitempty"`
	PciFriendlyNames     `yaml:",inline"`
	AdditionalProperties map[string]string `json:"additional-properties,omitempty" yaml:"additional-properties,omitempty"`
}

type PciFriendlyNames

type PciFriendlyNames struct {
	VendorName    *string `json:"vendor-name,omitempty" yaml:"vendor-name,omitempty"`
	DeviceName    *string `json:"device-name,omitempty" yaml:"device-name,omitempty"`
	SubvendorName *string `json:"subvendor-name,omitempty" yaml:"subvendor-name,omitempty"`
	SubdeviceName *string `json:"subdevice-name,omitempty" yaml:"subdevice-name,omitempty"`
}

Jump to

Keyboard shortcuts

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