model

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

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 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 BuildConfigFiles(cfg *types.Config, nm *types.NetworkModel, verbose bool) error

func BuildNetworkModel

func BuildNetworkModel(cfg *types.Config, d *Diagram, verbose bool) (nm *types.NetworkModel, err error)

func LoadModules

func LoadModules(cfg *types.Config) error

func ParseLabels

func ParseLabels(value string) (classes []string)

Types

type ConfigBlock

type ConfigBlock struct {
	Block    string
	Priority int
}

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 ConfigElementer interface {
	String() string
	StringLines() []string
}

type ConfigGroup

type ConfigGroup struct {
	Title string
	Depth int
	// contains filtered or unexported fields
}

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 Diagram

type Diagram struct {
	// contains filtered or unexported fields
}

func DiagramFromDotFile

func DiagramFromDotFile(filepath string) (*Diagram, error)

func (*Diagram) Groups

func (d *Diagram) Groups() map[string]*gographviz.SubGraph
func (d *Diagram) Links() []*gographviz.Edge

func (*Diagram) MergeDiagram

func (d *Diagram) MergeDiagram(d2 *Diagram)

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 (d *Diagram) SortedLinks() []*gographviz.Edge

func (*Diagram) SortedNodes

func (d *Diagram) SortedNodes() []*gographviz.Node

type SorterConfigBlocks

type SorterConfigBlocks struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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