Documentation ¶
Index ¶
- type Manager
- func (m *Manager) Add(ctx context.Context, s *hub.Subscription) error
- func (m *Manager) AddOptOut(ctx context.Context, o *hub.OptOut) error
- func (m *Manager) Delete(ctx context.Context, s *hub.Subscription) error
- func (m *Manager) DeleteOptOut(ctx context.Context, optOutID string) error
- func (m *Manager) GetByPackageJSON(ctx context.Context, packageID string) ([]byte, error)
- func (m *Manager) GetByUserJSON(ctx context.Context, p *hub.Pagination) (*hub.JSONQueryResult, error)
- func (m *Manager) GetOptOutListJSON(ctx context.Context, p *hub.Pagination) (*hub.JSONQueryResult, error)
- func (m *Manager) GetSubscriptors(ctx context.Context, e *hub.Event) ([]*hub.User, error)
- type ManagerMock
- func (m *ManagerMock) Add(ctx context.Context, s *hub.Subscription) error
- func (m *ManagerMock) AddOptOut(ctx context.Context, o *hub.OptOut) error
- func (m *ManagerMock) Delete(ctx context.Context, s *hub.Subscription) error
- func (m *ManagerMock) DeleteOptOut(ctx context.Context, optOutID string) error
- func (m *ManagerMock) GetByPackageJSON(ctx context.Context, packageID string) ([]byte, error)
- func (m *ManagerMock) GetByUserJSON(ctx context.Context, p *hub.Pagination) (*hub.JSONQueryResult, error)
- func (m *ManagerMock) GetOptOutListJSON(ctx context.Context, p *hub.Pagination) (*hub.JSONQueryResult, error)
- func (m *ManagerMock) GetSubscriptors(ctx context.Context, e *hub.Event) ([]*hub.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager provides an API to manage subscriptions.
func (*Manager) DeleteOptOut ¶ added in v0.5.0
DeleteOptOut deletes an opt-out entry from the database.
func (*Manager) GetByPackageJSON ¶
GetByPackageJSON returns the subscriptions the user has for a given package as json array of objects.
func (*Manager) GetByUserJSON ¶
func (m *Manager) GetByUserJSON(ctx context.Context, p *hub.Pagination) (*hub.JSONQueryResult, error)
GetByUserJSON returns all the subscriptions of the user doing the request as as json array of objects.
func (*Manager) GetOptOutListJSON ¶ added in v0.5.0
func (m *Manager) GetOptOutListJSON(ctx context.Context, p *hub.Pagination) (*hub.JSONQueryResult, error)
GetOptOutListJSON returns all the opt-out entries of the user doing the request as as json array of objects.
type ManagerMock ¶
ManagerMock is a mock implementation of the SubscriptionManager interface.
func (*ManagerMock) Add ¶
func (m *ManagerMock) Add(ctx context.Context, s *hub.Subscription) error
Add implements the SubscriptionManager interface.
func (*ManagerMock) AddOptOut ¶ added in v0.5.0
AddOptOut implements the SubscriptionManager interface.
func (*ManagerMock) Delete ¶
func (m *ManagerMock) Delete(ctx context.Context, s *hub.Subscription) error
Delete implements the SubscriptionManager interface.
func (*ManagerMock) DeleteOptOut ¶ added in v0.5.0
func (m *ManagerMock) DeleteOptOut(ctx context.Context, optOutID string) error
DeleteOptOut implements the SubscriptionManager interface.
func (*ManagerMock) GetByPackageJSON ¶
GetByPackageJSON implements the SubscriptionManager interface.
func (*ManagerMock) GetByUserJSON ¶
func (m *ManagerMock) GetByUserJSON(ctx context.Context, p *hub.Pagination) (*hub.JSONQueryResult, error)
GetByUserJSON implements the SubscriptionManager interface.
func (*ManagerMock) GetOptOutListJSON ¶ added in v0.5.0
func (m *ManagerMock) GetOptOutListJSON(ctx context.Context, p *hub.Pagination) (*hub.JSONQueryResult, error)
GetOptOutListJSON implements the SubscriptionManager interface.
func (*ManagerMock) GetSubscriptors ¶
GetSubscriptors implements the SubscriptionManager interface.