Documentation
¶
Index ¶
- type Subscriptions
- func (s *Subscriptions) Delete(topic string, user types.Uid) error
- func (s *Subscriptions) Get(topic string, user types.Uid, keepDeleted bool) (*types.Subscription, error)
- func (s *Subscriptions) SubsForTopic(topic string, keepDeleted bool, opts *types.QueryOpt) ([]types.Subscription, error)
- func (s *Subscriptions) SubsForUser(forUser types.Uid) ([]types.Subscription, error)
- func (s *Subscriptions) Update(topic string, user types.Uid, update map[string]any) error
- type SubscriptionsArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Subscriptions ¶
type Subscriptions struct {
// contains filtered or unexported fields
}
func NewSubscriptions ¶
func NewSubscriptions(sa SubscriptionsArgs) *Subscriptions
func (*Subscriptions) Delete ¶
func (s *Subscriptions) Delete(topic string, user types.Uid) error
Delete marks subscription as deleted.
func (*Subscriptions) Get ¶
func (s *Subscriptions) Get(topic string, user types.Uid, keepDeleted bool) (*types.Subscription, error)
Get a subscription of a user to a topic.
func (*Subscriptions) SubsForTopic ¶
func (s *Subscriptions) SubsForTopic(topic string, keepDeleted bool, opts *types.QueryOpt) ([]types.Subscription, error)
SubsForTopic fetches all subsciptions for a topic. Does NOT load Public value.
The difference between UsersForTopic vs SubsForTopic is that the former ¶
loads user.public+trusted, the latter does not.
func (*Subscriptions) SubsForUser ¶
func (s *Subscriptions) SubsForUser(forUser types.Uid) ([]types.Subscription, error)
SubsForUser loads all user's subscriptions. Does NOT load Public or Private
values and does not load deleted subscriptions.
type SubscriptionsArgs ¶
type SubscriptionsArgs struct { DB *pgxpool.Pool Utils *utils.Utils Cfg *config.StorePostgresConfig UGen *types.UidGenerator }
Click to show internal directories.
Click to hide internal directories.