subscription

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 8 Imported by: 1

Documentation

Index

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 (*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

func (*SubscriptionsMap) Notify

func (sub *SubscriptionsMap) Notify(peerID peer.ID, envelope *protocol.Envelope)

Jump to

Keyboard shortcuts

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