component

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component struct {
	Type            devicetypes.ComponentType         `json:"type"`
	Info            deviceinfo.DeviceInfo             `json:"info"`
	FirmwareVersion string                            `json:"firmware_version"`
	Position        InRackPosition                    `json:"position"`
	BmcsByType      map[devicetypes.BMCType][]bmc.BMC `json:"bmcs_by_type"`
	ComponentID     string                            `json:"component_id,omitempty"`
	RackID          uuid.UUID                         `json:"rack_id"`
	PowerState      string                            `json:"power_state,omitempty"`
	// contains filtered or unexported fields
}

Component represents a hardware component with various properties and associated BMCs.

func New

func New(
	t devicetypes.ComponentType,
	info *deviceinfo.DeviceInfo,
	firmwareVersion string,
	pos *InRackPosition,
) Component

New creates a new Component with the given type, device info, firmware version, and rack position.

func (*Component) AddBMC

func (c *Component) AddBMC(typ devicetypes.BMCType, info bmc.BMC) bool

AddBMC add the given BMC information to the Component.

func (*Component) IsCompute

func (c *Component) IsCompute() bool

IsCompute checks if the Component is of type Compute.

func (*Component) Patch

func (c *Component) Patch(p Component, allowNew bool) bool

Patch updates the firmware version and BMCs based on the given component. If allowNew is true, it adds new BMCs.

func (*Component) String

func (c *Component) String() string

String returns a string representation of the Component.

type InRackPosition

type InRackPosition struct {
	SlotID    int
	TrayIndex int
	HostID    int
}

InRackPosition represents the position of a component in a rack.

func (*InRackPosition) Compare

func (rc *InRackPosition) Compare(rc1 InRackPosition, upper bool) bool

Compare compares the current InRackPosition with another InRackPosition.

func (*InRackPosition) String

func (rc *InRackPosition) String() string

String returns a string representation of the InRackPosition.

Jump to

Keyboard shortcuts

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