transform

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTransformSummary

func BuildTransformSummary(inventory *devicetypes.Inventory) visual.ImportSummary

BuildTransformSummary creates a summary of transformed items for display.

func SetProviderGetter

func SetProviderGetter(getter func() interface {
	GetRecords() []import_.CsvRecord
})

SetProviderGetter allows the parent package to provide singleton access.

func SetSystemProviderGetter

func SetSystemProviderGetter(getter func() interface {
	GetSystemRecords() *import_.SystemCSV
	IsSystemImport() bool
})

SetSystemProviderGetter allows the parent package to provide system CSV access.

func Transform

func Transform(existing devicetypes.Inventory) (*devicetypes.TransformResult, error)

Transform converts raw records into CaniDeviceType, CaniRackType, and CaniCableType objects. Uses three passes: racks first, then devices (with parenting), then cables (with linking). Returns a TransformResult containing all created items.

func TransformSystem

func TransformSystem(existing devicetypes.Inventory, data *import_.SystemCSV) (*devicetypes.TransformResult, error)

TransformSystem converts parsed system CSV data into a TransformResult. Uses a 5-pass algorithm: roles → racks → devices → modules → connections.

Types

type CreatedItems

type CreatedItems struct {
	Racks   []*devicetypes.CaniRackType
	Devices []*devicetypes.CaniDeviceType
}

CreatedItems holds items created from a single CSV record for step display.

Jump to

Keyboard shortcuts

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