discovery

package
v0.23.4 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: AGPL-3.0 Imports: 9 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"`
	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
	// contains filtered or unexported fields
}

Discovery struct loads on cache, kad

architecture: Chore

func New

func New(logger *zap.Logger, ol *overlay.Service, contact *contact.Service, 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