Documentation
¶
Index ¶
- func NewInCache(db chat.Store) chat.Store
- type Cache
- func (c *Cache) AddGroupMembers(ctx context.Context, chatID *commonpb.ChatId, userIDs []*commonpb.UserId) error
- func (c *Cache) AdvanceLastMessage(ctx context.Context, chatID *commonpb.ChatId, messageID *messagingpb.MessageId, ...) (bool, []*commonpb.UserId, error)
- func (c *Cache) GetChatByID(ctx context.Context, chatID *commonpb.ChatId) (*chat.Chat, error)
- func (c *Cache) GetDmFeedPage(ctx context.Context, userID *commonpb.UserId, chatType chatpb.ChatType, ...) ([]*chat.Chat, error)
- func (c *Cache) GetMembers(ctx context.Context, chatID *commonpb.ChatId) ([]*commonpb.UserId, error)
- func (c *Cache) IsMember(ctx context.Context, chatID *commonpb.ChatId, userID *commonpb.UserId) (bool, error)
- func (c *Cache) PutChat(ctx context.Context, ch *chat.Chat) error
- func (c *Cache) RemoveGroupMember(ctx context.Context, chatID *commonpb.ChatId, userID *commonpb.UserId) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache wraps a chat.Store, caching DM membership checks. A DM's membership is fixed at chat creation and never changes, so a confirmed DM member is safe to cache. Group membership is mutable — and can be mutated by other processes, which this cache can never observe — so group membership checks always defer to the backing store. The rest of the store is passed straight through.
func (*Cache) AddGroupMembers ¶ added in v1.26.0
func (*Cache) AdvanceLastMessage ¶
func (*Cache) GetChatByID ¶
func (*Cache) GetDmFeedPage ¶
func (*Cache) GetMembers ¶
Click to show internal directories.
Click to hide internal directories.