Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTables ¶
func CreateTables(ctx context.Context, client *dynamodb.Client, chatsTable, dmInboxTable, groupMembersTable, userStateTable, activityTable, keyEnvelopesTable, lobbiesTable, featuredGroupsTable string) error
CreateTables provisions the chats, dm_inbox, group_members, chat_user_state, chat_activity, chat_key_envelopes, chat_lobbies and chat_featured_groups tables with on-demand billing. The chats table is keyed by pk only; dm_inbox is keyed by (pk, sk) with a GSI ordering each user's DMs by last_activity; group_members is keyed by (pk, sk) = (chat, user) — plus one "#meta" aggregates item per group — with an inverted GSI for listing a user's group chats, a sparse GSI of a group's joined members by join time (paging a large roster newest-first; see gsiByJoinedAt), and TTL on expires_at sweeping departed members' tombstones (see tombstoneTTL); chat_user_state is keyed by (pk, sk) = (user, chat) — plus one "#meta" aggregates item per chat — with a sparse GSI of a chat's recorded mutes by when they end (see gsiByMuted) and an inverted GSI of a chat's records by user (see gsiUserStateByUser); chat_activity is keyed by (pk, sk) = (chat, user) with two LSIs, one by last_sent_at (lsiByLastSentAt) and one by activity_score (lsiByActivityScore), and TTL on expires_at; chat_key_envelopes is keyed by (pk, sk) = (user, chat) with no index; chat_lobbies is keyed by (pk, sk) = (user, chat) — plus one "#meta" aggregates item per chat and per user — with a sparse GSI of a chat's lobby by entry time (see gsiLobbyByChat); chat_featured_groups is keyed by (pk, sk) = (user, position) — plus one "#meta" item per user — with no index. It is idempotent and blocks until all tables are ACTIVE.
func NewInDynamoDB ¶
func NewInDynamoDB(client *dynamodb.Client, chatsTable, dmInboxTable, groupMembersTable, userStateTable, activityTable, keyEnvelopesTable, lobbiesTable, featuredGroupsTable string, excludedFromFeed []*commonpb.UserId) chat.Store
NewInDynamoDB returns a chat.Store backed by the given DynamoDB tables, creating every DM with a user in excludedFromFeed excluding them from the feed (see chat.FeedExclusions); nil excludes no one. Use CreateTables to provision the tables.
Types ¶
This section is empty.