discovery

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGetPeers       = errors.New("[DISCOVERY]: get peer list failed")
	ErrConnectionFull = errors.New("[DISCOVERY]: node's incoming connection full")
	ErrPing           = errors.New("[DISCOVERY]: ping peer failed")
	ErrDHTBootstrap   = errors.New("[DISCOVERY]: DHT bootstrap failed")
)

Errors of peer discovery

Functions

This section is empty.

Types

type Service

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

Service is the struct for discovery service.

func New

func New(h p2p.Host, config service.NodeConfig, peerChan chan p2p.Peer, addPeer func(*p2p.Peer) bool) *Service

New returns discovery service. h is the p2p host config is the node config (TODO: leo, build two overlays of network)

func (*Service) APIs

func (s *Service) APIs() []rpc.API

APIs for the services.

func (*Service) Init

func (s *Service) Init()

Init is to initialize for discoveryService.

func (*Service) NotifyService

func (s *Service) NotifyService(params map[string]interface{})

NotifyService receives notification from service manager

func (*Service) Run

func (s *Service) Run()

Run is the main function of the service

func (*Service) SetMessageChan

func (s *Service) SetMessageChan(messageChan chan *msg_pb.Message)

SetMessageChan sets up message channel to service.

func (*Service) StartService

func (s *Service) StartService()

StartService starts discovery service.

func (*Service) StopService

func (s *Service) StopService()

StopService shutdowns discovery service.

Jump to

Keyboard shortcuts

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