Versions in this module Expand all Collapse all v0 v0.2.97 Oct 15, 2022 Changes in this version + var POLL_BUCKET = []byte("poll-list") + func NewStore(db *bbolt.DB) (*pollStore, error) + type MessageReceiver interface + AddMessageHandler func(func(peerId string, msgType string, payload []byte) error) + type MessageSender interface + SendMessage func(peerId string, message []byte, messageType int) error + type Messenger interface + type PeerGetter interface + GetPeers func() []string + type Policy interface + IsPeerAllowed func(peerId string) bool + type PollInfo struct + Assets []string + LastSeen time.Time + PeerAllowed bool + ProtocolVersion uint64 + type PollMessage struct + Assets []string + PeerAllowed bool + Version uint64 + func (PollMessage) MessageType() messages.MessageType + type PollNotFoundErr string + func (p PollNotFoundErr) Error() string + type RequestPollMessage struct + Assets []string + PeerAllowed bool + Version uint64 + func (RequestPollMessage) MessageType() messages.MessageType + type Service struct + func NewService(tickDuration time.Duration, removeDuration time.Duration, store Store, ...) *Service + func (s *Service) GetCompatiblePolls() (map[string]PollInfo, error) + func (s *Service) GetPollFrom(peerId string) (*PollInfo, error) + func (s *Service) GetPolls() (map[string]PollInfo, error) + func (s *Service) MessageHandler(peerId string, msgType string, payload []byte) error + func (s *Service) Poll(peer string) + func (s *Service) PollAllPeers() + func (s *Service) RequestAllPeerPolls() + func (s *Service) RequestPoll(peer string) + func (s *Service) Start() + func (s *Service) Stop() + type Store interface + GetAll func() (map[string]PollInfo, error) + RemoveUnseen func(olderThan time.Duration) error + Update func(peerId string, info PollInfo) error