bolt

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: ISC Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	*handler.Handler
	// contains filtered or unexported fields
}

Store represents a boltdb backed store.

func New

func New(file string) (*Store, error)

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

func (*Store) Get

func (s *Store) Get(topic, callback string) (*model.Subscription, error)

Get retrieves a subscription for the specified topic and callback.

func (*Store) Remove

func (s *Store) Remove(sub model.Subscription) error

Remove removes a subscription from the bucket for the specified topic.

Jump to

Keyboard shortcuts

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