From 01bb4bac6913908a7b2eabac8697fa710e09a857 Mon Sep 17 00:00:00 2001 From: Joel Rebello Date: Tue, 23 Apr 2024 15:25:05 +0200 Subject: [PATCH] ComponentTypes() returns the list of supported component types --- constants.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/constants.go b/constants.go index 572df70..443aeb8 100644 --- a/constants.go +++ b/constants.go @@ -27,6 +27,8 @@ const ( // Generic component slugs // Slugs are set on Device types to identify the type of component + // + // note: Enlist any new component types in the method further below. SlugBackplaneExpander = "Backplane-Expander" SlugChassis = "Chassis" SlugTPM = "TPM" @@ -64,6 +66,33 @@ const ( SlugRAIDImplHardware = "hardware" ) +func ComponentTypes() []string { + return []string{ + SlugBackplaneExpander, + SlugChassis, + SlugTPM, + SlugGPU, + SlugCPU, + SlugPhysicalMem, + SlugStorageController, + SlugStorageControllers, + SlugBMC, + SlugBIOS, + SlugDrive, + SlugDrives, + SlugDriveTypePCIeNVMEeSSD, + SlugDriveTypeSATASSD, + SlugDriveTypeSATAHDD, + SlugNIC, + SlugNICs, + SlugPSU, + SlugPSUs, + SlugCPLD, + SlugEnclosure, + SlugMainboard, + } +} + // FormatVendorName compares the given strings to identify and returned a known // vendor name. When a match is not found, the string is returned as is. //