Documentation ¶
Index ¶
- Variables
- type PeerSubscription
- type SubscriptionDetails
- func (s *SubscriptionDetails) Add(contentTopics ...string)
- func (s *SubscriptionDetails) Clone() *SubscriptionDetails
- func (s *SubscriptionDetails) Close() error
- func (s *SubscriptionDetails) CloseC()
- func (s *SubscriptionDetails) MarshalJSON() ([]byte, error)
- func (s *SubscriptionDetails) Remove(contentTopics ...string)
- type SubscriptionSet
- type SubscriptionsMap
- func (sub *SubscriptionsMap) Clear()
- func (sub *SubscriptionsMap) Delete(subscription *SubscriptionDetails) error
- func (sub *SubscriptionsMap) Has(peerID peer.ID, cf protocol.ContentFilter) bool
- func (sub *SubscriptionsMap) IsSubscribedTo(peerID peer.ID) bool
- func (sub *SubscriptionsMap) NewSubscription(peerID peer.ID, cf protocol.ContentFilter) *SubscriptionDetails
- func (sub *SubscriptionsMap) Notify(peerID peer.ID, envelope *protocol.Envelope)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type PeerSubscription ¶
type PeerSubscription struct { PeerID peer.ID SubsPerPubsubTopic map[string]SubscriptionSet }
type SubscriptionDetails ¶
type SubscriptionDetails struct { sync.RWMutex ID string Closed bool PeerID peer.ID ContentFilter protocol.ContentFilter C chan *protocol.Envelope // contains filtered or unexported fields }
func (*SubscriptionDetails) Add ¶
func (s *SubscriptionDetails) Add(contentTopics ...string)
func (*SubscriptionDetails) Clone ¶
func (s *SubscriptionDetails) Clone() *SubscriptionDetails
func (*SubscriptionDetails) Close ¶
func (s *SubscriptionDetails) Close() error
func (*SubscriptionDetails) CloseC ¶
func (s *SubscriptionDetails) CloseC()
func (*SubscriptionDetails) MarshalJSON ¶
func (s *SubscriptionDetails) MarshalJSON() ([]byte, error)
func (*SubscriptionDetails) Remove ¶
func (s *SubscriptionDetails) Remove(contentTopics ...string)
type SubscriptionSet ¶
type SubscriptionSet map[string]*SubscriptionDetails
Map of SubscriptionDetails.ID to subscriptions
type SubscriptionsMap ¶
type SubscriptionsMap struct { sync.RWMutex Items map[peer.ID]*PeerSubscription // contains filtered or unexported fields }
func NewSubscriptionMap ¶
func NewSubscriptionMap(logger *zap.Logger) *SubscriptionsMap
func (*SubscriptionsMap) Clear ¶
func (sub *SubscriptionsMap) Clear()
func (*SubscriptionsMap) Delete ¶
func (sub *SubscriptionsMap) Delete(subscription *SubscriptionDetails) error
func (*SubscriptionsMap) Has ¶
func (sub *SubscriptionsMap) Has(peerID peer.ID, cf protocol.ContentFilter) bool
Check if we have subscriptions for all (pubsubTopic, contentTopics[i]) pairs provided
func (*SubscriptionsMap) IsSubscribedTo ¶
func (sub *SubscriptionsMap) IsSubscribedTo(peerID peer.ID) bool
func (*SubscriptionsMap) NewSubscription ¶
func (sub *SubscriptionsMap) NewSubscription(peerID peer.ID, cf protocol.ContentFilter) *SubscriptionDetails
Click to show internal directories.
Click to hide internal directories.