devicetypes

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BMCTypeToString

func BMCTypeToString(bt BMCType) string

BMCTypeToString returns the string representation for the given BMC type.

func ComponentTypeToString

func ComponentTypeToString(ct ComponentType) string

ComponentTypeToString returns the string representation for the given component type.

func IsValidBMCTypeString

func IsValidBMCTypeString(str string) bool

func IsValidComponentTypeString

func IsValidComponentTypeString(str string) bool

IsValidComponentTypeString reports whether str maps to a known, non-Unknown ComponentType.

Types

type BMCType

type BMCType int
const (
	BMCTypeUnknown BMCType = iota
	BMCTypeHost
	BMCTypeDPU
)

func BMCTypeFromString

func BMCTypeFromString(str string) BMCType

BMCTypeFromString returns the BMC type from the given string.

func BMCTypes

func BMCTypes() []BMCType

BMCTypes returns all the supported BMC types

func (BMCType) String

func (bt BMCType) String() string

String return the aligned string representation for the given BMC type

type ComponentType

type ComponentType int

Define component types

const (
	ComponentTypeUnknown ComponentType = iota
	ComponentTypeCompute
	ComponentTypeNVLSwitch
	ComponentTypePowerShelf
	ComponentTypeToRSwitch
	ComponentTypeUMS
	ComponentTypeCDU
)

func ComponentTypeFromString

func ComponentTypeFromString(str string) ComponentType

ComponentTypeFromString returns the Component type from the given string.

func ComponentTypes

func ComponentTypes() []ComponentType

ComponentTypes returns all the supported Component types

func (ComponentType) MarshalJSON

func (ct ComponentType) MarshalJSON() ([]byte, error)

MarshalJSON serializes ComponentType as its string name (e.g. "Compute").

func (ComponentType) MarshalText

func (ct ComponentType) MarshalText() ([]byte, error)

MarshalText serializes ComponentType as its string name for use as a JSON map key (e.g. map[ComponentType]... → {"Compute": ...}).

func (ComponentType) String

func (ct ComponentType) String() string

String return the aligned string representation for the given component type

func (*ComponentType) UnmarshalJSON

func (ct *ComponentType) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a ComponentType from its string name (e.g. "compute"). Returns an error only if the string is unrecognized (i.e. not a valid component type name and not the canonical "Unknown" string), so that round-trip serialization of ComponentTypeUnknown is preserved.

func (*ComponentType) UnmarshalText

func (ct *ComponentType) UnmarshalText(data []byte) error

UnmarshalText parses a ComponentType from its string name when used as a JSON map key. Returns an error only if the string is unrecognized (i.e. not a valid component type name and not the canonical "Unknown" string), so that round-trip serialization of ComponentTypeUnknown is preserved.

Jump to

Keyboard shortcuts

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