Documentation
¶
Index ¶
- func Shuffle(a []string)
- type Mapper
- type Peer
- type RouteMap
- func (r *RouteMap) GetRoute(key string) *graph.NetworkRoute
- func (r *RouteMap) GetRouteOption(srcName string, srcPort int, dstName string, dstPort int) *graph.NetworkRoute
- func (r *RouteMap) IterRoutes(dstKey string, keysChan chan string)
- func (r *RouteMap) MarshalJSON() ([]byte, error)
- func (r *RouteMap) RemoveDst(dst string) []*graph.NetworkRoute
- func (r *RouteMap) ReplaceRoute(o, n *graph.NetworkRoute) int
- func (r *RouteMap) UpdateRouteOption(srcName string, srcPort int, dst string, newRoute *graph.NetworkRoute)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Mapper ¶
type Mapper struct { // graph of the network Graph *graph.NetworkGraph // map of how to send a packet on each route RouteMap *RouteMap // contains filtered or unexported fields }
Responsible for maintaining a `NetworkGraph` by mapping the network at a configured interval
func (*Mapper) IterPeers ¶
TODO: randomize shuffle (since this is used for mapping and pinging TODO: better, since this will be concurrent
func (*Mapper) RemovePeer ¶
type RouteMap ¶
type RouteMap struct { // key == srcName:srcPort,dstName:dstPort // key -> route NodeRouteMap map[string]*graph.NetworkRoute // contains filtered or unexported fields }
TODO: do our own route refcounting (up and down)
func NewRouteMap ¶
func NewRouteMap() *RouteMap
func (*RouteMap) GetRouteOption ¶
func (*RouteMap) IterRoutes ¶
TODO: embed the key in the route struct, so we can return a channel of *NetworkRoute
func (*RouteMap) MarshalJSON ¶
Fancy marshal method
func (*RouteMap) RemoveDst ¶
func (r *RouteMap) RemoveDst(dst string) []*graph.NetworkRoute
TODO: set port TODO: do our own route refcounting Remove all route options associated with dst
func (*RouteMap) ReplaceRoute ¶
func (r *RouteMap) ReplaceRoute(o, n *graph.NetworkRoute) int
Replace old route `o` with new route `n`, and return the number of times we did that
func (*RouteMap) UpdateRouteOption ¶
Click to show internal directories.
Click to hide internal directories.