discovery

package
v0.14.7 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 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 refreshed at each interval" default:"100"`
}

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.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) 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