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 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 ¶
View Source
const CONFIG_SEPARATOR = "%"
View Source
const ChildGroupsConfigHeader string = "groups" + NumberSeparator
View Source
const ChildInterfacesConfigHeader string = "interfaces" + NumberSeparator
View Source
const ChildMembersConfigHeader string = "members" + NumberSeparator
View Source
const ChildNeighborsConfigHeader string = "neighbors" + NumberSeparator
View Source
const ChildNodesConfigHeader string = "nodes" + NumberSeparator
View Source
const EmptyOutput string = "#EMPTY#"
View Source
const EmptySeparator string = "#NONE#"
View Source
const ManagementInterfaceName string = "mgmt"
View Source
const ManagementLayerReplacer string = "mgmt"
View Source
const NChars int = 32
View Source
const NumberAS string = "as"
View Source
const NumberNumber string = "number"
View Source
const NumberPrefixConnection string = "conn" + NumberSeparator
View Source
const NumberPrefixGroup string = "group" + NumberSeparator
View Source
const NumberPrefixMember string = "m" + NumberSeparator
View Source
const NumberPrefixNeighbor string = "n" + NumberSeparator
View Source
const NumberPrefixNode string = "node" + NumberSeparator
View Source
const NumberPrefixOppositeHeader string = "opp" + NumberSeparator
View Source
const NumberPrefixOppositeInterface string = "opp" + NumberSeparator
View Source
const NumberReplacerName string = "name"
View Source
const NumberSeparator string = "_"
View Source
const SelfConfigHeader string = "self" + NumberSeparator
Variables ¶
View Source
var SEPARATOR *regexp.Regexp
Functions ¶
func BuildConfigFiles ¶
func BuildNetworkModel ¶
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
Click to show internal directories.
Click to hide internal directories.