graph

package
v0.0.0-...-8887655 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2020 License: ISC Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Graph

type Graph struct {
	Switches map[string]*Switch
	Machines map[string]*Machine
	Mu       sync.RWMutex
}

func New

func New() *Graph

func (*Graph) FeedFromNetbox

func (g *Graph) FeedFromNetbox(ctx context.Context, nb *client.NetBox) error

func (*Graph) LoadConfig

func (g *Graph) LoadConfig(conf *pb.Config) error

func (*Graph) RemoveMachine

func (g *Graph) RemoveMachine(name string)

func (*Graph) RemoveSwitch

func (g *Graph) RemoveSwitch(name string)

type Machine

type Machine struct {
	Name     string
	Complete bool

	Ports map[string]*MachinePort
}

type MachinePort

type MachinePort struct {
	Machine  *Machine
	OtherEnd *SwitchPort
	Name     string
}

type Switch

type Switch struct {
	Name     string
	Complete bool

	Ports map[string]*SwitchPort
}

type SwitchPort

type SwitchPort struct {
	Switch   *Switch
	OtherEnd *MachinePort
	Name     string
}

Jump to

Keyboard shortcuts

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