hive2

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Kad               *kademlia.Kad
	Base              boson.Address
	AllowPrivateCIDRs bool
}

type Service

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

func New

func New(streamer p2p.StreamerPinger, addressBook addressbook.GetPutter, networkID uint64, logger logging.Logger) *Service

func (*Service) BroadcastPeers

func (s *Service) BroadcastPeers(ctx context.Context, addressee boson.Address, peers ...boson.Address) error

func (*Service) Close

func (s *Service) Close() error

func (*Service) DoFindNode

func (s *Service) DoFindNode(ctx context.Context, target, peer boson.Address, pos []int32, limit int32) (res chan boson.Address, err error)

func (*Service) IsHive2

func (s *Service) IsHive2() bool

func (*Service) IsStart

func (s *Service) IsStart() bool

func (*Service) Metrics

func (s *Service) Metrics() []prometheus.Collector

func (*Service) NotifyDiscoverWork

func (s *Service) NotifyDiscoverWork(peers ...boson.Address)

NotifyDiscoverWork notifies hive2 discover work.

func (*Service) Protocol

func (s *Service) Protocol() p2p.ProtocolSpec

func (*Service) SetAddPeersHandler

func (s *Service) SetAddPeersHandler(h func(addr ...boson.Address))

func (*Service) SetConfig

func (s *Service) SetConfig(config Config)

func (*Service) Start

func (s *Service) Start()

Directories

Path Synopsis
Package pb holds only Protocol Buffer definitions and generated code.
Package pb holds only Protocol Buffer definitions and generated code.

Jump to

Keyboard shortcuts

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