Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var WithAutoMgmtNetwork = func(t *T) { t.autoMgmt = true }
WithAutoMgmtNetwork enables an out-of-band management network. The topology is augmented with a management switch and server, with the latter running DHCP and DNS services for all devices. Devices are automatically attached to the management switch unless they have the no_mgmt node attribute set.
Functions ¶
func HasFunction ¶
func HasFunction(d *Device, fs ...DeviceFunction) bool
HasFunction returns whether d.Function() is in fs.
Types ¶
type Device ¶
type Device struct { Name string // contains filtered or unexported fields }
A Device corresponds to a node in the parsed topology.
func (*Device) Function ¶
func (d *Device) Function() DeviceFunction
Function returns the DeviceFunction associated with d.
func (*Device) MgmtIP ¶
MgmtIP returns the management IP address assigned to d (only when AutoMgmtNetwork is configured).
type DeviceFunction ¶
type DeviceFunction int
DeviceFunction describes a device's role in the topology and is used for startup ordering as well as determining default OS images.
const ( Fake DeviceFunction = iota // fake OOBServer // oob-server OOBSwitch // oob-switch Exit // exit SuperSpine // superspine Spine // spine Leaf // leaf TOR // tor Host // host NoFunction )
func (DeviceFunction) String ¶
func (i DeviceFunction) String() string
type Link ¶
type Link struct { From string FromPort string To string ToPort string // contains filtered or unexported fields }
A Link corresponds to an edge in the input graph and describes a point-to-point connection between two devices.
type T ¶
type T struct {
// contains filtered or unexported fields
}
T represents a parsed network topology graph.
func Parse ¶
Parse unmarshals a DOT graph. It returns the topology described by it or an error, if any.
func ParseFile ¶
ParseFile is like Parse but reads the DOT graph description from the file located by path.