dynamodb

package
v1.36.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 19 Imported by: 0

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, holdingsTable string) error

CreateTables provisions the chats, dm_inbox, group_members, chat_user_state, chat_activity, chat_key_envelopes, chat_lobbies, chat_featured_groups and chat_holdings 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), an inverted GSI of a chat's records by user (see gsiUserStateByUser) and a sparse GSI of a chat's restricted users by when they were restricted (see gsiRestricted); 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; chat_holdings is keyed by pk = chat with a GSI ranking a mint's groups by holdings (see gsiByMintRank) and a GSI of the refresh queue by due time (see refreshQueueIndex). It is idempotent and blocks until all tables are ACTIVE. It creates missing tables only: a table that exists is left as it is, and so is never given an index added to its definition here since it was created — gsiRestricted on a live chat_user_state is added out of band (see the store's doc).

func NewInDynamoDB

func NewInDynamoDB(client *dynamodb.Client, chatsTable, dmInboxTable, groupMembersTable, userStateTable, activityTable, keyEnvelopesTable, lobbiesTable, featuredGroupsTable, holdingsTable 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.

Jump to

Keyboard shortcuts

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