subscriptions

package
v0.0.0-...-b289748 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

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.

func (*Subscriptions) Update

func (s *Subscriptions) Update(topic string, user types.Uid, update map[string]any) error

Update updates one or multiple subscriptions to a topic.

type SubscriptionsArgs

type SubscriptionsArgs struct {
	DB     *pgxpool.Pool
	Utils  *utils.Utils
	Cfg    *config.StorePostgresConfig
	Shared *shared.Shared
	UGen   *types.UidGenerator
}

Jump to

Keyboard shortcuts

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