traversal

package
v2.17.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: MPL-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Operation

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

func Start

func Start(input OperationInput) *Operation

func (*Operation) AddNodes

func (op *Operation) AddNodes(nodes []types.AddrMaybeId) (added int)

func (*Operation) Closest

func (op *Operation) Closest() *k_nearest_nodes.Type

func (*Operation) Stalled

func (op *Operation) Stalled() events.Active

func (*Operation) Stats

func (op *Operation) Stats() *Stats

func (*Operation) Stop

func (op *Operation) Stop()

func (*Operation) Stopped

func (op *Operation) Stopped() events.Done

type OperationInput

type OperationInput struct {
	Target     krpc.ID
	Alpha      int
	K          int
	DoQuery    func(context.Context, krpc.NodeAddr) QueryResult
	NodeFilter func(types.AddrMaybeId) bool
}

type QueryResult

type QueryResult struct {
	// A node that should be considered for a closest entry.
	ResponseFrom *krpc.NodeInfo
	// Data associated with a closest node.
	ClosestData interface{}
	Nodes       []krpc.NodeInfo
	Nodes6      []krpc.NodeInfo
}

type Stats

type Stats struct {
	// Count of (probably) distinct addresses we've sent traversal queries to. Accessed with atomic.
	NumAddrsTried uint32
	// Number of responses we received to queries related to this traversal. Accessed with atomic.
	NumResponses uint32
}

Jump to

Keyboard shortcuts

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