discovery

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 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"`
	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 read from the overlay in a single pagination call" default:"100"`
	RefreshConcurrency int           `help:"the amount of nodes refreshed in parallel" default:"8"`
}

Config loads on the configuration values for the cache

type Discovery

type Discovery struct {
	Refresh   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.Service, 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) Run

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

Run runs the discovery service

Jump to

Keyboard shortcuts

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