Documentation ¶
Index ¶
- type Topics
- func (t *Topics) ChannelsForUser(uid types.Uid) ([]string, error)
- func (t *Topics) Create(topic *types.Topic) error
- func (t *Topics) CreateP2P(initiator, invited *types.Subscription) error
- func (t *Topics) Delete(topic string, isChan, hard bool) error
- func (t *Topics) Get(topic string) (*types.Topic, error)
- func (t *Topics) OwnTopics(uid types.Uid) ([]string, error)
- func (t *Topics) Share(shares []*types.Subscription) error
- func (t *Topics) TopicsForUser(uid types.Uid, keepDeleted bool, opts *types.QueryOpt) ([]types.Subscription, error)
- func (t *Topics) Update(topic string, update map[string]any) error
- func (t *Topics) UpdateOnMessage(topic string, msg *types.Message) error
- func (t *Topics) UpdateTopicOwner(topic string, newOwner types.Uid) error
- func (t *Topics) UsersForTopic(topic string, keepDeleted bool, opts *types.QueryOpt) ([]types.Subscription, error)
- type TopicsArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Topics ¶
type Topics struct {
// contains filtered or unexported fields
}
func NewTopics ¶
func NewTopics(ta TopicsArgs) *Topics
func (*Topics) ChannelsForUser ¶
ChannelsForUser loads a slice of topic names where the user is a channel
reader and notifications (P) are enabled.
func (*Topics) CreateP2P ¶
func (t *Topics) CreateP2P(initiator, invited *types.Subscription) error
CreateP2P given two users creates a p2p topic
func (*Topics) Get ¶
Get loads a single topic by name, if it exists. If the topic does not exist the call returns (nil, nil)
func (*Topics) Share ¶
func (t *Topics) Share(shares []*types.Subscription) error
Share() creates topic subscriptions
func (*Topics) TopicsForUser ¶
func (t *Topics) TopicsForUser(uid types.Uid, keepDeleted bool, opts *types.QueryOpt) ([]types.Subscription, error)
TopicsForUser loads user's contact list:
p2p and grp topics, except for 'me' & 'fnd' subscriptions.
Reads and denormalizes Public value.
func (*Topics) UpdateOnMessage ¶
UpdateOnMessage increments Topic's or User's SeqId value and updates TouchedAt timestamp.
func (*Topics) UpdateTopicOwner ¶
UpdateTopicOwner updates topic's owner
func (*Topics) UsersForTopic ¶
func (t *Topics) UsersForTopic(topic string, keepDeleted bool, opts *types.QueryOpt) ([]types.Subscription, error)
UsersForTopic loads users subscribed to the given topic.
The difference between UsersForTopic vs SubsForTopic is that the former loads user.Public,
the latter does not.
type TopicsArgs ¶
type TopicsArgs struct { DB *pgxpool.Pool Utils *utils.Utils Cfg *config.StorePostgresConfig Logger *logger.Logger UGen *types.UidGenerator }