Documentation
¶
Index ¶
- func ConvertLocalInventoryToVendors(macAddresses []string, deviceType string) []*vendors.InventoryItem
- func EnhanceInventoryItems(items []*vendors.InventoryItem) []*vendors.InventoryItem
- func EnhanceInventoryItemsWithClient(items []*vendors.InventoryItem, _ interface{}) []*vendors.InventoryItem
- func HandleCommand(ctx context.Context, client api.Client, cfg *config.Config, args []string, ...) error
- func ListInventory(ctx context.Context, client api.Client, cfg *config.Config, deviceType string, ...) error
- type LocalInventoryFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertLocalInventoryToVendors ¶
func ConvertLocalInventoryToVendors(macAddresses []string, deviceType string) []*vendors.InventoryItem
ConvertLocalInventoryToVendors converts local inventory items to vendors inventory items by retrieving device data from the cache using O(1) MAC lookups
func EnhanceInventoryItems ¶
func EnhanceInventoryItems(items []*vendors.InventoryItem) []*vendors.InventoryItem
EnhanceInventoryItems ensures all required fields for display are populated With vendors.InventoryItem using plain strings, this is simpler than the legacy version
func EnhanceInventoryItemsWithClient ¶
func EnhanceInventoryItemsWithClient(items []*vendors.InventoryItem, _ interface{}) []*vendors.InventoryItem
EnhanceInventoryItemsWithClient ensures all required fields for display are populated This version accepts a client parameter for dependency injection (currently unused)
Types ¶
type LocalInventoryFile ¶
type LocalInventoryFile struct {
Version int `json:"version"`
Metadata struct {
Description string `json:"description"`
} `json:"metadata"`
Config struct {
Inventory struct {
AP []string `json:"ap"`
Switch []string `json:"switch"`
Gateway []string `json:"gateway"`
} `json:"inventory"`
} `json:"config"`
}
LocalInventoryFile represents the structure of the inventory.json file
func LoadLocalInventory ¶
func LoadLocalInventory(filePath string) (*LocalInventoryFile, error)
LoadLocalInventory loads the inventory from the local inventory file