cache

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInCache

func NewInCache(db chat.Store) chat.Store

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache wraps a chat.Store, caching membership checks. Membership is fixed at chat creation and never changes, so a confirmed member is safe to cache; the rest of the store is passed straight through.

func (*Cache) AdvanceLastMessage

func (c *Cache) AdvanceLastMessage(ctx context.Context, chatID *commonpb.ChatId, messageID *messagingpb.MessageId, ts time.Time) (bool, error)

func (*Cache) GetChatByID

func (c *Cache) GetChatByID(ctx context.Context, chatID *commonpb.ChatId) (*chat.Chat, error)

func (*Cache) GetDmFeedPage

func (c *Cache) GetDmFeedPage(ctx context.Context, userID *commonpb.UserId, snapshot time.Time, cursor *chat.DmFeedCursor, limit int) ([]*chat.Chat, error)

func (*Cache) GetMembers

func (c *Cache) GetMembers(ctx context.Context, chatID *commonpb.ChatId) ([]*commonpb.UserId, error)

func (*Cache) IsMember

func (c *Cache) IsMember(ctx context.Context, chatID *commonpb.ChatId, userID *commonpb.UserId) (bool, error)

func (*Cache) PutChat

func (c *Cache) PutChat(ctx context.Context, ch *chat.Chat) error

Jump to

Keyboard shortcuts

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