Documentation
¶
Index ¶
- Variables
- func ValidateBios(v *validator.Validator, bios *Bios)
- func ValidateCPU(v *validator.Validator, cpu *CPU)
- func ValidateDIMM(v *validator.Validator, dimm *DIMM)
- func ValidateDevice(v *validator.Validator, device *Device)
- func ValidateDisk(v *validator.Validator, disks *Disk)
- func ValidateFilters(v *validator.Validator, f Filters)
- func ValidateKernel(v *validator.Validator, kernel *Kernel)
- func ValidateMemory(v *validator.Validator, memory *Memory)
- func ValidateMotherboard(v *validator.Validator, motherboard *Motherboard)
- func ValidateNetwork(v *validator.Validator, network *Network)
- func ValidateNetworkInterface(v *validator.Validator, networkInterface *NetworkInterface)
- func ValidateNetworkInterfaceDriver(v *validator.Validator, networkInterfaceDriver *NetworkInterfaceDriver)
- func ValidateOEM(v *validator.Validator, oem *OEM)
- func ValidatePartition(v *validator.Validator, partition *Partition)
- func ValidateRelease(v *validator.Validator, release *Release)
- func ValidateSpecs(v *validator.Validator, specs *Specs)
- func ValidateSwapDevice(v *validator.Validator, swapDevice *SwapDevice)
- func ValidateVirtualization(v *validator.Validator, virtualization *Virtualization)
- func WithPreloads(db *gorm.DB) *gorm.DB
- type Bios
- type CPU
- type DIMM
- type Device
- type DeviceModel
- func (m DeviceModel) Delete(uuid uuid.UUID, s SearchModel) error
- func (m DeviceModel) Get(uuid uuid.UUID) (*Device, error)
- func (m DeviceModel) GetAll(searchTerms string, filters Filters) ([]*Device, Metadata, error)
- func (m DeviceModel) Insert(device *Device, s SearchModel) error
- func (m DeviceModel) Update(device *Device, s SearchModel) error
- type Disk
- type Filters
- type Kernel
- type Memory
- type Metadata
- type Models
- type Motherboard
- type Network
- type NetworkInterface
- type NetworkInterfaceDriver
- type OEM
- type Partition
- type Release
- type Search
- type SearchModel
- type ServerInfo
- type ServerInfoSystemInfo
- type Specs
- type SwapDevice
- type Virtualization
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrDuplicateDeviceID = errors.New("duplicate device")
)
View Source
var (
ErrRecordNotFound = errors.New("record not found")
)
Functions ¶
func ValidateBios ¶
func ValidateCPU ¶
func ValidateDIMM ¶
func ValidateDevice ¶
func ValidateDisk ¶
func ValidateFilters ¶
func ValidateKernel ¶
func ValidateMemory ¶
func ValidateMotherboard ¶
func ValidateMotherboard(v *validator.Validator, motherboard *Motherboard)
func ValidateNetwork ¶
func ValidateNetworkInterface ¶
func ValidateNetworkInterface(v *validator.Validator, networkInterface *NetworkInterface)
func ValidateNetworkInterfaceDriver ¶
func ValidateNetworkInterfaceDriver(v *validator.Validator, networkInterfaceDriver *NetworkInterfaceDriver)
func ValidateOEM ¶
func ValidatePartition ¶
func ValidateRelease ¶
func ValidateSpecs ¶
func ValidateSwapDevice ¶
func ValidateSwapDevice(v *validator.Validator, swapDevice *SwapDevice)
func ValidateVirtualization ¶
func ValidateVirtualization(v *validator.Validator, virtualization *Virtualization)
Types ¶
type Bios ¶
type CPU ¶
type CPU struct {
ID uint `json:"-"`
SpecsID uint `json:"-"`
Name string `json:"name,omitempty"`
Architecture string `json:"architecture,omitempty"`
CoreCount int32 `json:"core_count,omitempty"`
CPUCount int32 `json:"cpu_count,omitempty"`
MaxFrequencyMegahertz int32 `json:"max_frequency_megahertz,omitempty"`
Mitigations pq.StringArray `json:"mitigations,omitempty" gorm:"type:text[]"`
}
type DIMM ¶
type DIMM struct {
ID uint `json:"-"`
SpecsID uint `json:"-"`
SizeGigabytes int32 `json:"size_gigabytes,omitempty"`
Speed int32 `json:"speed_mt_s,omitempty"`
Manufacturer string `json:"manufacturer,omitempty"`
SerialNumber string `json:"serial_number,omitempty"`
Type string `json:"type,omitempty"`
PartNumber string `json:"part_number,omitempty"`
FormFactor string `json:"form_factor,omitempty"`
Locator string `json:"locator,omitempty"`
BankLocator string `json:"bank_locator,omitempty"`
}
type Device ¶
type DeviceModel ¶
func (DeviceModel) Delete ¶
func (m DeviceModel) Delete(uuid uuid.UUID, s SearchModel) error
func (DeviceModel) Insert ¶
func (m DeviceModel) Insert(device *Device, s SearchModel) error
func (DeviceModel) Update ¶
func (m DeviceModel) Update(device *Device, s SearchModel) error
type Disk ¶
type Kernel ¶
type Memory ¶
type Memory struct {
ID uint `json:"-"`
SpecsID uint `json:"-"`
Memory int32 `json:"memory,omitempty"`
Swap int32 `json:"swap,omitempty"`
SwapDevices []SwapDevice `json:"swap_devices,omitempty" gorm:"constraint:OnDelete:CASCADE"`
}
type Metadata ¶
type Metadata struct {
CurrentPage int `json:"current_page,omitempty"`
PageSize int `json:"page_size,omitempty"`
FirstPage int `json:"first_page,omitempty"`
LastPage int `json:"last_page,omitempty"`
TotalRecords int `json:"total_records,omitempty"`
}
Metadata contains pagination metadata.
type Motherboard ¶
type Motherboard struct {
ID uint `json:"-"`
SpecsID uint `json:"-"`
Vendor string `json:"vendor,omitempty"`
Name string `json:"name,omitempty"`
SerialNumber string `json:"serial_number,omitempty"`
}
func (Motherboard) String ¶
func (m Motherboard) String() string
type Network ¶
type Network struct {
ID uint `json:"-"`
SpecsID uint `json:"-"`
Hostname string `json:"hostname,omitempty"`
Interfaces []NetworkInterface `json:"interfaces,omitempty" gorm:"constraint:OnDelete:CASCADE"`
}
type NetworkInterface ¶
type NetworkInterface struct {
ID uint `json:"-"`
NetworkID uint `json:"-"`
MACAddress string `json:"mac_address,omitempty"`
Driver NetworkInterfaceDriver `json:"driver,omitempty" gorm:"constraint:OnDelete:CASCADE"`
IPv4Addresses pq.StringArray `json:"ipv4_addresses,omitempty" gorm:"type:text[]"`
IPv6Addresses pq.StringArray `json:"ipv6_addresses,omitempty" gorm:"type:text[]"`
}
func (NetworkInterface) String ¶
func (n NetworkInterface) String() string
type NetworkInterfaceDriver ¶
type NetworkInterfaceDriver struct {
ID uint `json:"-"`
NetworkInterfaceID uint `json:"-"`
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
FirmwareVersion string `json:"firmware_version,omitempty"`
}
func (NetworkInterfaceDriver) String ¶
func (nid NetworkInterfaceDriver) String() string
type OEM ¶
type Partition ¶
type Release ¶
type SearchModel ¶
func (SearchModel) Insert ¶
func (m SearchModel) Insert(search *Search) error
type ServerInfo ¶
type ServerInfo struct {
Status string `json:"status,omitempty"`
SystemInfo ServerInfoSystemInfo `json:"system_info,omitempty"`
}
type ServerInfoSystemInfo ¶
type Specs ¶
type Specs struct {
ID uint `json:"-"`
DeviceID uuid.UUID `json:"-"`
BootTime time.Time `json:"boot_time,omitempty"`
Motherboard Motherboard `json:"motherboard,omitempty" gorm:"constraint:OnDelete:CASCADE"`
CPU CPU `json:"cpu,omitempty" gorm:"constraint:OnDelete:CASCADE"`
Disks []Disk `json:"disks,omitempty" gorm:"constraint:OnDelete:CASCADE"`
Network Network `json:"network,omitempty" gorm:"constraint:OnDelete:CASCADE"`
Bios Bios `json:"bios,omitempty" gorm:"constraint:OnDelete:CASCADE"`
Memory Memory `json:"memory,omitempty" gorm:"constraint:OnDelete:CASCADE"`
Kernel Kernel `json:"kernel,omitempty" gorm:"constraint:OnDelete:CASCADE"`
Release Release `json:"release,omitempty" gorm:"constraint:OnDelete:CASCADE"`
DIMMs []DIMM `json:"dimms,omitempty" gorm:"constraint:OnDelete:CASCADE"`
Virtualization Virtualization `json:"virtualization,omitempty" gorm:"constraint:OnDelete:CASCADE"`
OEM OEM `json:"oem,omitempty" gorm:"constraint:OnDelete:CASCADE"`
}
type SwapDevice ¶
type SwapDevice struct {
ID uint `json:"-"`
MemoryID uint `json:"-"`
Name string `json:"name,omitempty"`
Size int32 `json:"size,omitempty"`
}
func (SwapDevice) String ¶
func (s SwapDevice) String() string
type Virtualization ¶
type Virtualization struct {
ID uint `json:"-"`
SpecsID uint `json:"-"`
Type string `json:"type,omitempty"`
}
func (Virtualization) String ¶
func (v Virtualization) String() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.