Documentation
¶
Index ¶
- type Config
- type Edge
- type FixedConfig
- type Game
- type Graph
- func (g *Graph) AddBidirectionalEdge(from, to string, weight float64)
- func (g *Graph) AddEdge(from, to string, weight float64)
- func (g *Graph) Flush()
- func (g *Graph) IterateEdges(from string) []string
- func (g *Graph) Print() string
- func (g *Graph) PrintRoutes(start string, end string) string
- func (g *Graph) RemoveBidirectionalEdge(from, to string)
- func (g *Graph) RemoveEdge(from, to string)
- func (g *Graph) RemoveNode(node string)
- func (g *Graph) ShortestPath(start, target string) ([]string, float64)
- type Item
- type Latencies
- type Node
- type PriorityQueue
- type SignedConfig
- type System
- type WhiteOrBlackList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FixedConfig ¶
type FixedConfig struct {
SuperAdminPubKey string `json:"super_admin_pub_key" msgpack:"super_admin_pub_key"`
ConfigPath string `json:"config_path" msgpack:"config_path"`
DataPath string `json:"data_path" msgpack:"data_path"`
BoostrapNodes []string `json:"bootstrap_nodes" msgpack:"bootstrap_nodes"`
Port uint `json:"port" msgpack:"port"`
}
type Game ¶
type Game struct {
ID string `json:"id" msgpack:"id"`
Protocol string `json:"protocol" msgpack:"protocol"`
Host string `json:"host" msgpack:"host"`
Port uint64 `json:"port" msgpack:"port"`
ListenPort uint64 `json:"listen_port" msgpack:"listen_port"`
ExitNode WhiteOrBlackList `json:"exit_node" msgpack:"exit_node"`
EntryNode WhiteOrBlackList `json:"entry_node" msgpack:"entry_node"`
SpeedTestProtocol string `json:"speed_test_protocol" msgpack:"speed_test_protocol"`
}
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph represents a graph with an adjacency list.
func (*Graph) AddBidirectionalEdge ¶
func (*Graph) IterateEdges ¶
func (*Graph) RemoveBidirectionalEdge ¶
func (*Graph) RemoveEdge ¶
RemoveEdge removes an edge from the graph.
func (*Graph) RemoveNode ¶
RemoveNode removes a node and all its associated edges from the graph.
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Define a structure for items in the priority queue
type PriorityQueue ¶
type PriorityQueue []*Item
A PriorityQueue implements heap.Interface and holds Items.
func (PriorityQueue) Len ¶
func (pq PriorityQueue) Len() int
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
func (PriorityQueue) Swap ¶
func (pq PriorityQueue) Swap(i, j int)
type SignedConfig ¶
type WhiteOrBlackList ¶
Click to show internal directories.
Click to hide internal directories.