store

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: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("subscription not found")
)

Functions

This section is empty.

Types

type Added

type Added struct {
	Subscription model.Subscription
}

Added represents an event when a subscription is added to the store.

type Removed

type Removed struct {
	Subscription model.Subscription
}

Removed represents an event when a subscription is removed from the store.

type Store

type Store interface {
	// All returns all subscriptions for the specified topic.
	All(topic string) ([]model.Subscription, error)

	// For returns the subscriptions for the specified callback
	For(callback string) ([]model.Subscription, error)

	// Add saves/adds a subscription to the store.
	Add(sub model.Subscription) error

	// Get retrieves a subscription given a topic and callback.
	Get(topic, callback string) (*model.Subscription, error)

	// Remove removes a subscription from the store.
	Remove(sub model.Subscription) error
}

Store defines an interface for stores to implement for data storage.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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