routing

package
v0.0.0-...-eea8d2e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2022 License: GPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Addr

type Addr []string

func (*Addr) Scan

func (a *Addr) Scan(value any) error

func (Addr) Value

func (a Addr) Value() (driver.Value, error)

type Table

type Table struct {
	Protocol string
	// contains filtered or unexported fields
}

func (*Table) AddAndConnectTracker

func (r *Table) AddAndConnectTracker(ctx context.Context, tracker *Tracker)

func (*Table) AddTracker

func (r *Table) AddTracker(tracker *Tracker)

func (*Table) FindTracker

func (r *Table) FindTracker(ctx context.Context, id *big.Int, numRequest int, recvTimeout time.Duration)

func (*Table) FindTrackerOnce

func (r *Table) FindTrackerOnce(ctx context.Context, id []byte, candidates []*Tracker, recvTimeout time.Duration)

func (*Table) GetNeighbors

func (r *Table) GetNeighbors(targetIDInt *big.Int, num int, excludeID ...*big.Int) []*Tracker

func (*Table) GetTracker

func (r *Table) GetTracker(id []byte) *Tracker

func (*Table) Init

func (r *Table) Init(ctx context.Context, trackers []*Tracker)

func (*Table) RemoveTracker

func (r *Table) RemoveTracker(id *big.Int)

type Tracker

type Tracker struct {
	ID   *big.Int
	Addr Addr

	LiveFlag int32
	// contains filtered or unexported fields
}

func (*Tracker) Connect

func (t *Tracker) Connect(ctx context.Context, protocol string, cert ...*tls.Certificate) error

func (*Tracker) GetAddrStr

func (t *Tracker) GetAddrStr() string

func (*Tracker) Session

func (t *Tracker) Session() *pie.Session

func (*Tracker) SetAddrStr

func (t *Tracker) SetAddrStr(addr string) error

type TreeNode

type TreeNode struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL