discovery

package
v0.0.0-...-34879f3 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressManager

type AddressManager interface {
	AddNewAddr(tentacle.SessionID, multiaddr.Multiaddr)
	AddNewAddrs(tentacle.SessionID, []multiaddr.Multiaddr)
	Misbehave(tentacle.SessionID, Misbehavior) *MisbehaveResult
	GetRandom(int) []multiaddr.Multiaddr
}

AddressManager ..

type MisbehaveResult

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

MisbehaveResult report result

func Continue

func Continue() *MisbehaveResult

Continue to run

func Disconnect

func Disconnect() *MisbehaveResult

Disconnect this peer

type Misbehavior

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

Misbehavior to report to underlying peer storage

func (*Misbehavior) String

func (m *Misbehavior) String() string

type Protocol

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

Protocol discovery protocol stuct

func NewProtocol

func NewProtocol(addrMgr AddressManager, queryCycle time.Duration, checkInterval time.Duration, globalIPOnly bool) *Protocol

NewProtocol create a discovery protocol

func (*Protocol) Connected

func (p *Protocol) Connected(ctx *tentacle.ProtocolContextRef, version string)

Connected ..

func (*Protocol) Disconnected

func (p *Protocol) Disconnected(ctx *tentacle.ProtocolContextRef)

Disconnected ..

func (*Protocol) Init

func (p *Protocol) Init(ctx *tentacle.ProtocolContext)

Init ..

func (*Protocol) Notify

func (p *Protocol) Notify(ctx *tentacle.ProtocolContext, token uint64)

Notify ..

func (*Protocol) Received

func (p *Protocol) Received(ctx *tentacle.ProtocolContextRef, data []byte)

Received ..

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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