inventory

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: Apache-2.0 Imports: 14 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

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)

func HandleCommand

func HandleCommand(ctx context.Context, client api.Client, cfg *config.Config, args []string, formatOverride string, showAll ...bool) error

HandleCommand processes inventory-related subcommands

func ListInventory

func ListInventory(ctx context.Context, client api.Client, cfg *config.Config, deviceType string, siteName string, formatOverride string, showAllFields bool) error

ListInventory shows inventory items of a specific type or all items, optionally filtered by site

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

Jump to

Keyboard shortcuts

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