Documentation
¶
Index ¶
- Constants
- type BcastSendCallback
- type Channel
- type Controller
- func (c *Controller) AddEdge(p1, p2 ctype.Addr, cid ctype.CidType, tokenAddr ctype.Addr) error
- func (c *Controller) BuildTable(tokenAddr ctype.Addr) (map[ctype.Addr]ctype.CidType, error)
- func (c *Controller) GetAllNeighbors() map[ctype.Addr]*NeighborInfo
- func (c *Controller) RecvBcastRoutingInfo(info *rpc.RoutingRequest) error
- func (c *Controller) RemoveEdge(cid ctype.CidType) error
- func (c *Controller) Start()
- type Data
- type Edge
- type Forwarder
- func (f *Forwarder) LookupEgressChannelOnPay(payID ctype.PayIDType) (ctype.CidType, ctype.Addr, error)
- func (f *Forwarder) LookupIngressChannelOnPay(payID ctype.PayIDType) (ctype.CidType, ctype.Addr, error)
- func (f *Forwarder) LookupNextChannelOnToken(dest ctype.Addr, token ctype.Addr) (ctype.CidType, ctype.Addr, error)
- type Graph
- type NeighborInfo
- type OspEdge
- type OspInfo
- type QueueElement
- type RoutingPolicy
- type VertexQueue
- type VertexType
- type WeightType
Constants ¶
View Source
const (
Infinity = WeightType(^uint(0) >> 1)
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BcastSendCallback ¶
type BcastSendCallback func(info *rpc.RoutingRequest, ospAddrs []string)
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller configs to handle onchain router-related event
func NewController ¶
func NewController( nodeConfig common.GlobalNodeConfig, transactor *eth.Transactor, monitorService intfs.MonitorService, ethclient *ethclient.Client, dal *storage.DAL, signer eth.Signer, bcastSendCallback BcastSendCallback, routingData []byte, rpcHost string, explorerUrl string) (*Controller, error)
NewController creates a new process for router controller
func (*Controller) BuildTable ¶
func (*Controller) GetAllNeighbors ¶
func (c *Controller) GetAllNeighbors() map[ctype.Addr]*NeighborInfo
func (*Controller) RecvBcastRoutingInfo ¶
func (c *Controller) RecvBcastRoutingInfo(info *rpc.RoutingRequest) error
New routing information arrived from another OSP. Enqueue it for a future route recomputation and, if needed, forward it to other peer OSPs in the broadcast.
func (*Controller) RemoveEdge ¶
func (c *Controller) RemoveEdge(cid ctype.CidType) error
func (*Controller) Start ¶
func (c *Controller) Start()
Start starts router process to instantiate OSP as a router.
type Forwarder ¶
type Forwarder struct {
// contains filtered or unexported fields
}
func NewForwarder ¶
func (*Forwarder) LookupEgressChannelOnPay ¶
func (*Forwarder) LookupIngressChannelOnPay ¶
type NeighborInfo ¶
type QueueElement ¶
type QueueElement struct {
// contains filtered or unexported fields
}
type RoutingPolicy ¶
type RoutingPolicy int
const ( NoRoutingPolicy RoutingPolicy = 1 << iota GateWayPolicy RoutingPolicy = 1 << iota ServiceProviderPolicy RoutingPolicy = 1 << iota )
type VertexQueue ¶
type VertexQueue struct {
// contains filtered or unexported fields
}
A VertexQueue is the priority queue for elements
func (*VertexQueue) Len ¶
func (q *VertexQueue) Len() int
func (*VertexQueue) Less ¶
func (q *VertexQueue) Less(i, j int) bool
func (*VertexQueue) Pop ¶
func (q *VertexQueue) Pop() interface{}
func (*VertexQueue) Push ¶
func (q *VertexQueue) Push(x interface{})
func (*VertexQueue) Swap ¶
func (q *VertexQueue) Swap(i, j int)
type VertexType ¶
type VertexType = string
type WeightType ¶
type WeightType = int
Click to show internal directories.
Click to hide internal directories.