Documentation ¶
Index ¶
- Variables
- type Config
- type Index
- type Path
- type PendCallResItem
- type PendingCallResArray
- type Route
- type RouteTab
- type Service
- func (s *Service) Close() error
- func (s *Service) Connect(ctx context.Context, target boson.Address) error
- func (s *Service) DelRoute(ctx 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) 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
- func (s *Service) SetConfig(cfg Config)
- type Table
- func (t *Table) Delete(path *Path)
- func (t *Table) Gc(expire time.Duration)
- func (t *Table) Get(dest boson.Address) ([]*Path, error)
- func (t *Table) GetNextHop(dest boson.Address, sign []byte) (next boson.Address)
- func (t *Table) ReqToResp(req *pb.RouteReq, paths []*Path) *pb.RouteResp
- func (t *Table) ReqToSave(req *pb.RouteReq) error
- func (t *Table) RespToSave(resp *pb.RouteResp) error
- func (t *Table) RespToSaveOne(p *pb.Path) error
- func (t *Table) ResumeRoute()
- func (t *Table) ResumeSigned()
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MaxTTL uint8 = 10 DefaultNeighborAlpha 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 ¶ added in v1.0.9
type PendingCallResArray ¶ added in v1.0.9
type PendingCallResArray []*PendCallResItem
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) }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) GetTargetNeighbor ¶
func (*Service) Metrics ¶
func (s *Service) Metrics() []prometheus.Collector
func (*Service) Protocol ¶
func (s *Service) Protocol() p2p.ProtocolSpec
type Table ¶ added in v1.0.9
type Table struct {
// contains filtered or unexported fields
}
func (*Table) GetNextHop ¶ added in v1.0.9
func (*Table) ResumeRoute ¶ added in v1.0.9
func (t *Table) ResumeRoute()
func (*Table) ResumeSigned ¶ added in v1.0.9
func (t *Table) ResumeSigned()
Click to show internal directories.
Click to hide internal directories.