Documentation ¶
Index ¶
- type Config
- type MemoryStorage
- func (m *MemoryStorage) CreateSubscription(item subscription.Item) (bool, error)
- func (m *MemoryStorage) DisableSubscription(item subscription.Item) error
- func (m *MemoryStorage) EnableSubscription(item subscription.Item) error
- func (m *MemoryStorage) ReadAllSubscriptions() ([]subscription.Item, error)
- func (m *MemoryStorage) ReadSubscriptions() ([]subscription.Item, error)
- func (m *MemoryStorage) ReadSubscriptionsByShopItem(item shop.Item) ([]subscription.Item, error)
- func (m *MemoryStorage) ReadUserAllSubscriptions(user subscription.User) ([]subscription.Item, error)
- func (m *MemoryStorage) ReadUserSubscriptions(user subscription.User) ([]subscription.Item, error)
- func (m *MemoryStorage) RemoveSubscription(item subscription.Item) (bool, error)
- type MongoConfig
- type MongoStorage
- func (m *MongoStorage) CreateSubscription(item subscription.Item) (bool, error)
- func (m *MongoStorage) DisableSubscription(item subscription.Item) error
- func (m *MongoStorage) EnableSubscription(item subscription.Item) error
- func (m *MongoStorage) ReadAllSubscriptions() ([]subscription.Item, error)
- func (m *MongoStorage) ReadSubscriptions() ([]subscription.Item, error)
- func (m *MongoStorage) ReadSubscriptionsByShopItem(item shop.Item) ([]subscription.Item, error)
- func (m *MongoStorage) ReadUserAllSubscriptions(user subscription.User) ([]subscription.Item, error)
- func (m *MongoStorage) ReadUserSubscriptions(user subscription.User) ([]subscription.Item, error)
- func (m *MongoStorage) RemoveSubscription(item subscription.Item) (bool, error)
- type NoOptions
- type ShopItem
- type Storage
- type SubscriptionItem
- type SubscriptionUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryStorage ¶
type MemoryStorage struct {
// contains filtered or unexported fields
}
MemoryStorage describes in-memory storage for subscriptions
func NewMemoryStorage ¶
func NewMemoryStorage() *MemoryStorage
NewMemoryStorage constructs new instance of MemoryStorage
func (*MemoryStorage) CreateSubscription ¶
func (m *MemoryStorage) CreateSubscription(item subscription.Item) (bool, error)
CreateSubscription creates new subscription from subscription storage
func (*MemoryStorage) DisableSubscription ¶
func (m *MemoryStorage) DisableSubscription(item subscription.Item) error
func (*MemoryStorage) EnableSubscription ¶
func (m *MemoryStorage) EnableSubscription(item subscription.Item) error
func (*MemoryStorage) ReadAllSubscriptions ¶
func (m *MemoryStorage) ReadAllSubscriptions() ([]subscription.Item, error)
func (*MemoryStorage) ReadSubscriptions ¶
func (m *MemoryStorage) ReadSubscriptions() ([]subscription.Item, error)
ReadSubscriptions reads all subscriptions from subscription storage
func (*MemoryStorage) ReadSubscriptionsByShopItem ¶
func (m *MemoryStorage) ReadSubscriptionsByShopItem(item shop.Item) ([]subscription.Item, error)
func (*MemoryStorage) ReadUserAllSubscriptions ¶
func (m *MemoryStorage) ReadUserAllSubscriptions(user subscription.User) ([]subscription.Item, error)
func (*MemoryStorage) ReadUserSubscriptions ¶
func (m *MemoryStorage) ReadUserSubscriptions(user subscription.User) ([]subscription.Item, error)
func (*MemoryStorage) RemoveSubscription ¶
func (m *MemoryStorage) RemoveSubscription(item subscription.Item) (bool, error)
type MongoConfig ¶
type MongoStorage ¶
type MongoStorage struct {
// contains filtered or unexported fields
}
func NewMongo ¶
func NewMongo(uri string) (*MongoStorage, error)
func NewMongoWithConfig ¶
func NewMongoWithConfig(config MongoConfig) (*MongoStorage, error)
func (*MongoStorage) CreateSubscription ¶
func (m *MongoStorage) CreateSubscription(item subscription.Item) (bool, error)
func (*MongoStorage) DisableSubscription ¶
func (m *MongoStorage) DisableSubscription(item subscription.Item) error
func (*MongoStorage) EnableSubscription ¶
func (m *MongoStorage) EnableSubscription(item subscription.Item) error
func (*MongoStorage) ReadAllSubscriptions ¶
func (m *MongoStorage) ReadAllSubscriptions() ([]subscription.Item, error)
func (*MongoStorage) ReadSubscriptions ¶
func (m *MongoStorage) ReadSubscriptions() ([]subscription.Item, error)
func (*MongoStorage) ReadSubscriptionsByShopItem ¶
func (m *MongoStorage) ReadSubscriptionsByShopItem(item shop.Item) ([]subscription.Item, error)
func (*MongoStorage) ReadUserAllSubscriptions ¶
func (m *MongoStorage) ReadUserAllSubscriptions(user subscription.User) ([]subscription.Item, error)
func (*MongoStorage) ReadUserSubscriptions ¶
func (m *MongoStorage) ReadUserSubscriptions(user subscription.User) ([]subscription.Item, error)
func (*MongoStorage) RemoveSubscription ¶
func (m *MongoStorage) RemoveSubscription(item subscription.Item) (bool, error)
type Storage ¶
type Storage interface { CreateSubscription(subscription.Item) (bool, error) DisableSubscription(subscription.Item) error EnableSubscription(subscription.Item) error ReadAllSubscriptions() ([]subscription.Item, error) ReadSubscriptions() ([]subscription.Item, error) ReadSubscriptionsByShopItem(shop.Item) ([]subscription.Item, error) ReadUserAllSubscriptions(subscription.User) ([]subscription.Item, error) ReadUserSubscriptions(subscription.User) ([]subscription.Item, error) RemoveSubscription(subscription.Item) (bool, error) }
type SubscriptionItem ¶
type SubscriptionItem struct { Active bool ShopItem ShopItem User SubscriptionUser }
type SubscriptionUser ¶
type SubscriptionUser struct {
ID string
}
Click to show internal directories.
Click to hide internal directories.