Documentation
¶
Index ¶
- Constants
- Variables
- type Options
- type Path
- type PendCallResItem
- type PendingCallResArray
- type RelayStream
- type RouteTab
- type Service
- func (s *Service) Close() error
- func (s *Service) Connect(ctx context.Context, target boson.Address) error
- func (s *Service) DelRoute(_ context.Context, target boson.Address) error
- func (s *Service) FindRoute(ctx context.Context, target boson.Address, timeout ...time.Duration) (paths []*Path, err error)
- func (s *Service) FindUnderlay(ctx context.Context, target boson.Address) (addr *address.Address, err error)
- func (s *Service) GetNextHopRandomOrFind(ctx context.Context, target boson.Address, skips ...boson.Address) (next boson.Address, err error)
- func (s *Service) GetRoute(_ context.Context, dest boson.Address) ([]*Path, error)
- func (s *Service) GetTargetNeighbor(ctx context.Context, target boson.Address, limit int) (addresses []boson.Address, err error)
- func (s *Service) IsNeighbor(dest boson.Address) (has bool)
- func (s *Service) Metrics() []prometheus.Collector
- func (s *Service) Protocol() p2p.ProtocolSpec
- type Table
- func (t *Table) Delete(path *Path)
- func (t *Table) Gc(expire time.Duration)
- func (t *Table) Get(target boson.Address) ([]*Path, error)
- func (t *Table) GetNextHop(target boson.Address, skips ...boson.Address) (next []boson.Address)
- func (t *Table) IterateTarget(items []boson.Address, fn func(target boson.Address))
- func (t *Table) ResumePaths()
- func (t *Table) ResumeRoutes()
- func (t *Table) SavePath(p *pb.Path)
- func (t *Table) SavePaths(paths []*pb.Path)
- type TargetRoute
Constants ¶
View Source
const ( ProtocolName = "router" ProtocolVersion = "4.0.0" StreamOnRelay = "relay" StreamOnRelayConnChain = "relayConnChain" )
Variables ¶
View Source
var ( MaxTTL int32 = 10 NeighborAlpha int32 = 2 )
View Source
var (
ErrNotFound = errors.New("route: not found")
)
View Source
var (
PendingTimeout = time.Second * 5
)
Functions ¶
This section is empty.
Types ¶
type PendCallResItem ¶
type PendingCallResArray ¶
type PendingCallResArray []*PendCallResItem
type RelayStream ¶
type RouteTab ¶
type RouteTab interface { GetRoute(ctx context.Context, dest boson.Address) (paths []*Path, err error) FindRoute(ctx context.Context, dest boson.Address, timeout ...time.Duration) (paths []*Path, err error) DelRoute(ctx context.Context, dest boson.Address) (err error) Connect(ctx context.Context, dest boson.Address) error GetTargetNeighbor(ctx context.Context, dest boson.Address, limit int) (addresses []boson.Address, err error) IsNeighbor(dest boson.Address) (has bool) FindUnderlay(ctx context.Context, target boson.Address) (addr *address.Address, err error) }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) FindUnderlay ¶
func (*Service) GetNextHopRandomOrFind ¶
func (*Service) GetTargetNeighbor ¶
func (*Service) Metrics ¶
func (s *Service) Metrics() []prometheus.Collector
func (*Service) Protocol ¶
func (s *Service) Protocol() p2p.ProtocolSpec
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
func (*Table) GetNextHop ¶
func (*Table) IterateTarget ¶
func (*Table) ResumePaths ¶
func (t *Table) ResumePaths()
func (*Table) ResumeRoutes ¶
func (t *Table) ResumeRoutes()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.