discovery

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Error is a general error class of this package
	Error = errs.Class("discovery error")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	RefreshInterval   time.Duration `help:"the interval at which the cache refreshes itself in seconds" default:"1s"`
	GraveyardInterval time.Duration `help:"the interval at which the the graveyard tries to resurrect nodes" default:"30s"`
	DiscoveryInterval time.Duration `help:"the interval at which the satellite attempts to find new nodes via random node ID lookups" default:"1s"`
	RefreshLimit      int           `help:"the amount of nodes refreshed at each interval" default:"100"`
}

Config loads on the configuration values for the cache

type Discovery

type Discovery struct {
	Refresh   sync2.Cycle
	Graveyard sync2.Cycle
	Discovery sync2.Cycle
	// contains filtered or unexported fields
}

Discovery struct loads on cache, kad

func New

func New(logger *zap.Logger, ol *overlay.Cache, kad *kademlia.Kademlia, config Config) *Discovery

New returns a new discovery service.

func (*Discovery) Close

func (discovery *Discovery) Close() error

Close closes resources

func (*Discovery) ConnFailure

func (d *Discovery) ConnFailure(ctx context.Context, node *pb.Node, err error)

ConnFailure implements the Transport Observer interface `ConnFailure` function

func (*Discovery) ConnSuccess

func (d *Discovery) ConnSuccess(ctx context.Context, node *pb.Node)

ConnSuccess implements the Transport Observer interface `ConnSuccess` function

func (*Discovery) GracefulDisconnect

func (d *Discovery) GracefulDisconnect(id storj.NodeID)

GracefulDisconnect is called when a node alerts the network they're going offline for a short period of time with intent to come back

func (*Discovery) Run

func (discovery *Discovery) Run(ctx context.Context) error

Run runs the discovery service

Jump to

Keyboard shortcuts

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