Documentation ¶
Index ¶
- type Store
- func (s *Store) Add(sub model.Subscription) error
- func (s *Store) All(topic string) ([]model.Subscription, error)
- func (s *Store) Cleanup()
- func (s *Store) For(callback string) ([]model.Subscription, error)
- func (s *Store) Get(topic, callback string) (*model.Subscription, error)
- func (s *Store) Remove(sub model.Subscription) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
Store represents a boltdb backed store.
func New ¶
New creates a new boltdb store. Bolt is fine for low throughput applications, though a full database should be used for performance.
func (*Store) Add ¶
func (s *Store) Add(sub model.Subscription) error
Add stores a subscription in the bucket for the specified topic.
func (*Store) All ¶
func (s *Store) All(topic string) ([]model.Subscription, error)
All retrieves all active subscriptions for a topic.
func (*Store) Cleanup ¶
func (s *Store) Cleanup()
Cleanup will loop all buckets and keys, expiring subscriptions that are old.
func (*Store) For ¶ added in v1.2.0
func (s *Store) For(callback string) ([]model.Subscription, error)
For returns the subscriptions for the specified callback
Click to show internal directories.
Click to hide internal directories.