Documentation
¶
Index ¶
- type Example
- func (p *Example) BindExportFlags(cmd *cobra.Command) error
- func (p *Example) BindImportFlags(cmd *cobra.Command) error
- func (p *Example) ClearRecords()
- func (p *Example) ClearSystemRecords()
- func (p *Example) Export(cmd *cobra.Command, args []string, inventory *devicetypes.Inventory) error
- func (p *Example) GetDefaultOptions() map[string]any
- func (p *Example) GetExportDefaults() map[string]any
- func (p *Example) GetExportOptionsStruct() interface{}
- func (p *Example) GetImportDefaults() map[string]any
- func (p *Example) GetImportOptionsStruct() interface{}
- func (p *Example) GetOptionsStruct() interface{}
- func (p *Example) GetRecords() []import_.CsvRecord
- func (p *Example) GetSystemRecords() *import_.SystemCSV
- func (p *Example) Import(cmd *cobra.Command, args []string, inventory *devicetypes.Inventory) error
- func (p *Example) IsSystemImport() bool
- func (p *Example) NewProviderCmd(base *cobra.Command) (*cobra.Command, error)
- func (p *Example) SetRecords(records []import_.CsvRecord)
- func (p *Example) SetSystemRecords(data *import_.SystemCSV)
- func (p *Example) Slug() string
- func (p *Example) Transform(existing devicetypes.Inventory) (*devicetypes.TransformResult, error)
- type ExportOptions
- type ImportOptions
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Example ¶
type Example struct {
Options *ImportOptions
// RawRecords holds all raw CSV records from the import phase
RawRecords []import_.CsvRecord
// SystemData holds parsed system CSV data (multi-section format)
SystemData *import_.SystemCSV
}
Example implements the provider.Provider interface
func GetInstance ¶
func GetInstance() *Example
GetInstance returns the singleton Example provider instance. Used by sub-packages to store/access raw records between ETL phases.
func (*Example) BindExportFlags ¶
BindExportFlags binds CLI flags to Viper for the export command. This enables precedence: CLI flags > env vars > config file > defaults.
func (*Example) BindImportFlags ¶
BindImportFlags binds CLI flags to Viper for the import command. This enables precedence: CLI flags > env vars > config file > defaults.
func (*Example) ClearRecords ¶
func (p *Example) ClearRecords()
ClearRecords resets the raw record storage for a fresh import
func (*Example) ClearSystemRecords ¶
func (p *Example) ClearSystemRecords()
ClearSystemRecords resets system CSV data
func (*Example) Export ¶
Export syncs the local CANI inventory to an external system. This is the "Load" step in ETL.
func (*Example) GetDefaultOptions ¶
GetDefaultOptions returns the default configuration options for this provider. These are auto-populated in the config file if they do not exist.
func (*Example) GetExportDefaults ¶
GetExportDefaults returns default export configuration options.
func (*Example) GetExportOptionsStruct ¶
func (p *Example) GetExportOptionsStruct() interface{}
GetExportOptionsStruct returns the export options struct for reflection.
func (*Example) GetImportDefaults ¶
GetImportDefaults returns default import configuration options.
func (*Example) GetImportOptionsStruct ¶
func (p *Example) GetImportOptionsStruct() interface{}
GetImportOptionsStruct returns the import options struct for reflection.
func (*Example) GetOptionsStruct ¶
func (p *Example) GetOptionsStruct() interface{}
GetOptionsStruct returns the configuration struct for comment extraction. This enables YAML serialization with preserved field ordering and comments.
func (*Example) GetRecords ¶
GetRecords returns the raw records for the transform phase
func (*Example) GetSystemRecords ¶
GetSystemRecords returns the system CSV data for transform
func (*Example) Import ¶
Import syncs the local CANI inventory from an external system. This is the "Extract" step in ETL.
func (*Example) IsSystemImport ¶
IsSystemImport returns true if a system CSV was parsed
func (*Example) NewProviderCmd ¶
NewProviderCmd returns provider-specific CLI commands. This is called for each base command (import, add, show, etc.) to allow the provider to customize or extend the command.
func (*Example) SetRecords ¶
SetRecords stores raw records from the import phase
func (*Example) SetSystemRecords ¶
SetSystemRecords stores parsed system CSV data
func (*Example) Transform ¶
func (p *Example) Transform(existing devicetypes.Inventory) (*devicetypes.TransformResult, error)
Transform converts queued data into CANI types (devices, racks, cables). Delegates to the transform package which processes all records in a single pass.
type ExportOptions ¶
type ExportOptions struct {
}
ExportOptions holds export-specific configuration. These options correspond to CLI flags for the export command. TODO: Add export-specific configuration fields
type ImportOptions ¶
type ImportOptions struct {
}
ImportOptions holds import-specific configuration. These options correspond to CLI flags for the import command. TODO: Add import-specific configuration fields