graph

package
v0.0.0-...-f5ddc1b Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TopologyGraph

type TopologyGraph struct {

	// User preferences
	MatchPolicy string
	Region      string
	// contains filtered or unexported fields
}

func NewTopologyGraph

func NewTopologyGraph(matchPolicy string, region string) *TopologyGraph

A NewTopologyGraph is associated with a region and match policy

func (*TopologyGraph) AddEdge

func (t *TopologyGraph) AddEdge(source string, dest string)

AddEdge adds a bidirectional edge to the graph

func (*TopologyGraph) AddNode

func (t *TopologyGraph) AddNode(node *graph.Node)

AddNode adds a node to the graph

func (*TopologyGraph) CreateEdges

func (t *TopologyGraph) CreateEdges()

CreateEdges creates all edges at once

func (*TopologyGraph) CreateNodes

func (t *TopologyGraph) CreateNodes()

CreateNodes creates all nodes at once

func (*TopologyGraph) GetUniqueId

func (t *TopologyGraph) GetUniqueId(name string) *UniqueId

Get a unique id for a node (instance or network node) We need both int and string, so we return a struct

func (*TopologyGraph) NewInstanceNode

func (t *TopologyGraph) NewInstanceNode(instance *ec2.InstanceTopology) *graph.Node

NewInstanceNode creates a new instance node for the graph

func (*TopologyGraph) NewNetworkNode

func (t *TopologyGraph) NewNetworkNode(name string, nodes []string, idx int) *graph.Node

NewNetworkNode creates a new network node We return a graph node, and a boolean to indicate created or not nodes should be the complete list of nodes, and idx the index of the network node in it

func (*TopologyGraph) Reset

func (t *TopologyGraph) Reset()

Reset the topology graph to a "zero" count and no nodes seen or created

func (*TopologyGraph) Topology

func (t *TopologyGraph) Topology(group string, instance string, saveFile string) error

This is to say that nn-ec17* is at the top, and the instance is connected directly to nn-a59. This means that two instances connected to that node are close together. The closer two instances are in the graph, overall, the closer. That is all of the information that we have!

type UniqueId

type UniqueId struct {
	Uid  int32
	Name string
}

A unique id can hold the id and return string and other derivates of it

func (*UniqueId) String

func (u *UniqueId) String() string

String converts the int uid to a string

Jump to

Keyboard shortcuts

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