kademliaclient

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

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

Conn represents a connection

type Dialer

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

Dialer sends requests to kademlia endpoints on storage nodes

func NewDialer

func NewDialer(log *zap.Logger, transport transport.Client) *Dialer

NewDialer creates a new kademlia dialer.

func (*Dialer) AlertSuccess

func (dialer *Dialer) AlertSuccess(ctx context.Context, node *pb.Node)

AlertSuccess alerts the transport observers of a successful connection

func (*Dialer) Close

func (dialer *Dialer) Close() error

Close closes the pool resources and prevents new connections to be made.

func (*Dialer) FetchInfo

func (dialer *Dialer) FetchInfo(ctx context.Context, target pb.Node) (_ *pb.InfoResponse, err error)

FetchInfo connects to a node and returns its node info.

func (*Dialer) FetchPeerIdentity

func (dialer *Dialer) FetchPeerIdentity(ctx context.Context, target pb.Node) (_ *identity.PeerIdentity, err error)

FetchPeerIdentity connects to a node and returns its peer identity

func (*Dialer) FetchPeerIdentityUnverified

func (dialer *Dialer) FetchPeerIdentityUnverified(ctx context.Context, address string, opts ...grpc.CallOption) (_ *identity.PeerIdentity, err error)

FetchPeerIdentityUnverified connects to an address and returns its peer identity (no node ID verification).

func (*Dialer) Lookup

func (dialer *Dialer) Lookup(ctx context.Context, self *pb.Node, ask pb.Node, find storj.NodeID, limit int) (_ []*pb.Node, err error)

Lookup queries ask about find, and also sends information about self. If self is nil, pingback will be false.

func (*Dialer) PingNode

func (dialer *Dialer) PingNode(ctx context.Context, target pb.Node) (_ bool, err error)

PingNode pings target.

Jump to

Keyboard shortcuts

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