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) NotifyService ¶
NotifyService receives notification from service manager
func (*Service) SetMessageChan ¶
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.
Click to show internal directories.
Click to hide internal directories.