Documentation
¶
Index ¶
- Constants
- Variables
- func BuildConfigFiles(cfg *types.Config, nm *types.NetworkModel, verbose bool) error
- func BuildNetworkModel(cfg *types.Config, d *Diagram, verbose bool) (nm *types.NetworkModel, err error)
- func BuildNetworkModelForFileList(cfg *types.Config, d *Diagram) (nm *types.NetworkModel, err error)
- func ListGeneratedFiles(cfg *types.Config, nm *types.NetworkModel, verbose bool) ([]string, error)
- func LoadModules(cfg *types.Config) error
- func ParseLabels(value string) (classes []string)
- type ChildConfig
- type ConfigAggregator
- type ConfigBlock
- type ConfigElement
- type ConfigElementer
- type ConfigGroup
- type ConfigGrouper
- type ConfigTemplateDependencyNode
- type DependencyGraph
- type DependencyNode
- type Diagram
- func (d *Diagram) Groups() map[string]*gographviz.SubGraph
- func (d *Diagram) Links() []*gographviz.Edge
- func (d *Diagram) MergeDiagram(d2 *Diagram)
- func (d *Diagram) NodeGroups(name string) (groups []*gographviz.SubGraph)
- func (d *Diagram) Nodes() []*gographviz.Node
- func (d *Diagram) SortedLinks() []*gographviz.Edge
- func (d *Diagram) SortedNodes() []*gographviz.Node
- type NameSpacerDependencyNode
Constants ¶
const CONFIG_SEPARATOR = "%"
const EmptyOutput string = "#EMPTY#"
const EmptySeparator string = "#NONE#"
const ManagementInterfaceName string = "mgmt"
const ManagementLayerReplacer string = "mgmt"
const NChars int = 32
const NumberAS string = "as"
const NumberNumber string = "number"
Variables ¶
var SEPARATOR *regexp.Regexp
Functions ¶
func BuildConfigFiles ¶
func BuildNetworkModel ¶
func BuildNetworkModelForFileList ¶ added in v0.6.0
func BuildNetworkModelForFileList(cfg *types.Config, d *Diagram) (nm *types.NetworkModel, err error)
BuildNetworkModelForFileList builds a lightweight NetworkModel sufficient for file listing. This function only processes the minimum required for FilesToGenerate() to work: - Module loading (for FileDefinitions) - Topology skeleton (nodes, interfaces, class labels) - Class validation It skips expensive operations like IP address assignment and parameter generation.
func ListGeneratedFiles ¶ added in v0.5.0
ListGeneratedFiles returns a list of files that would be generated by generateConfigFiles
func LoadModules ¶
func ParseLabels ¶
Types ¶
type ChildConfig ¶ added in v0.5.0
type ChildConfig struct {
// contains filtered or unexported fields
}
type ConfigAggregator ¶ added in v0.5.0
type ConfigAggregator struct {
// contains filtered or unexported fields
}
type ConfigBlock ¶
type ConfigElement ¶
type ConfigElement struct {
Line string
}
func (*ConfigElement) String ¶
func (e *ConfigElement) String() string
func (*ConfigElement) StringLines ¶
func (e *ConfigElement) StringLines() []string
type ConfigElementer ¶
type ConfigGroup ¶
func (*ConfigGroup) Add ¶
func (g *ConfigGroup) Add(line string)
func (*ConfigGroup) AddElement ¶
func (g *ConfigGroup) AddElement(e ConfigElementer)
func (*ConfigGroup) Get ¶
func (g *ConfigGroup) Get(title string) (ConfigGrouper, bool)
func (*ConfigGroup) String ¶
func (g *ConfigGroup) String() string
func (*ConfigGroup) StringLines ¶
func (g *ConfigGroup) StringLines() []string
type ConfigGrouper ¶
type ConfigGrouper interface {
Add(string)
AddElement(ConfigElementer)
Get(string) (ConfigGrouper, bool)
String() string
StringLines() []string
}
type ConfigTemplateDependencyNode ¶ added in v0.5.0
type ConfigTemplateDependencyNode struct {
// contains filtered or unexported fields
}
ConfigTemplateDependencyNode adapts ConfigTemplate to DependencyNode interface
func (*ConfigTemplateDependencyNode) GetDependencies ¶ added in v0.5.0
func (ctdn *ConfigTemplateDependencyNode) GetDependencies() ([]string, error)
func (*ConfigTemplateDependencyNode) GetID ¶ added in v0.5.0
func (ctdn *ConfigTemplateDependencyNode) GetID() string
func (*ConfigTemplateDependencyNode) GetItem ¶ added in v0.5.0
func (ctdn *ConfigTemplateDependencyNode) GetItem() *types.ConfigTemplate
type DependencyGraph ¶ added in v0.5.0
type DependencyGraph[T any] struct { // contains filtered or unexported fields }
DependencyGraph handles topological sorting of dependency nodes
func NewDependencyGraph ¶ added in v0.5.0
func NewDependencyGraph[T any]() *DependencyGraph[T]
func (*DependencyGraph[T]) AddNode ¶ added in v0.5.0
func (dg *DependencyGraph[T]) AddNode(node DependencyNode[T])
func (*DependencyGraph[T]) TopologicalSort ¶ added in v0.5.0
func (dg *DependencyGraph[T]) TopologicalSort() ([]T, error)
type DependencyNode ¶ added in v0.5.0
type DependencyNode[T any] interface { GetID() string GetDependencies() ([]string, error) GetItem() T }
DependencyNode represents a node in dependency graph
type Diagram ¶
type Diagram struct {
// contains filtered or unexported fields
}
func DiagramFromDotFile ¶
func (*Diagram) Links ¶
func (d *Diagram) Links() []*gographviz.Edge
func (*Diagram) MergeDiagram ¶
Merge Diagram merge components in two Diagram objects. Labels in same components are merged. Lines are considered same only when the end nodes and "their ports" are completely same (Note that links without specified ports are always considered different).
func (*Diagram) NodeGroups ¶
func (d *Diagram) NodeGroups(name string) (groups []*gographviz.SubGraph)
func (*Diagram) Nodes ¶
func (d *Diagram) Nodes() []*gographviz.Node
func (*Diagram) SortedLinks ¶
func (d *Diagram) SortedLinks() []*gographviz.Edge
func (*Diagram) SortedNodes ¶
func (d *Diagram) SortedNodes() []*gographviz.Node
type NameSpacerDependencyNode ¶ added in v0.5.0
type NameSpacerDependencyNode struct {
// contains filtered or unexported fields
}
NameSpacerDependencyNode adapts NameSpacer to DependencyNode interface
func (*NameSpacerDependencyNode) GetDependencies ¶ added in v0.5.0
func (nsdn *NameSpacerDependencyNode) GetDependencies() ([]string, error)
func (*NameSpacerDependencyNode) GetID ¶ added in v0.5.0
func (nsdn *NameSpacerDependencyNode) GetID() string
func (*NameSpacerDependencyNode) GetItem ¶ added in v0.5.0
func (nsdn *NameSpacerDependencyNode) GetItem() types.NameSpacer