Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/kenn-io/msgvault
/ functions
Functions
5,225 in github.com/kenn-io/msgvault
⨍
Functions
5,225
◇
Types & classes
632
↓ 3 callers
Method
MaintenanceTimeoutResetSQL
MaintenanceTimeoutResetSQL returns a statement that disables any per-statement execution timeout for the remainder of the current transaction, or "" i
internal/store/dialect.go:275
↓ 3 callers
Method
MarkMessagesDeletedByGmailIDBatch
MarkMessagesDeletedByGmailIDBatch marks multiple messages as deleted by their Gmail IDs in batched UPDATE statements. Much faster than individual Mark
internal/store/messages.go:827
↓ 3 callers
Function
NewControllerTestEnv
NewControllerTestEnv creates a ControllerTestEnv with a temporary directory and deletion manager wired to the given engine.
internal/tui/actions_test.go:27
↓ 3 callers
Function
NewManager
NewManager creates an OAuth manager from client secrets.
internal/oauth/oauth.go:72
↓ 3 callers
Function
NewPostgreSQLEngine
NewPostgreSQLEngine creates a query engine backed by PostgreSQL. The engine uses PostgreSQLQueryDialect for all SQL generation: $N placeholders via Re
internal/query/postgres.go:40
↓ 3 callers
Function
NewXOAuth2Client
NewXOAuth2Client creates a SASL client for XOAUTH2 authentication.
internal/imap/xoauth2.go:23
↓ 3 callers
Method
OnComplete
(succeeded, failed int)
internal/deletion/executor.go:38
↓ 3 callers
Method
OnStart
(total, alreadyProcessed int)
internal/deletion/executor.go:36
↓ 3 callers
Function
OpenPostgresDB
OpenPostgresDB opens a raw *sql.DB handle for the given PostgreSQL URL using the same connection config (statement_timeout, runtime params) as Store.O
internal/store/store.go:340
↓ 3 callers
Function
OpenRemoteStore
OpenRemoteStore opens a remote store, returning error if not configured. Unlike OpenStore, this always attempts remote connection.
cmd/msgvault/cmd/store_resolver.go:119
↓ 3 callers
Function
ParseFile
ParseFile reads and parses an .emlx file from disk.
internal/emlx/reader.go:80
↓ 3 callers
Function
PathTraversalCases
PathTraversalCases returns a fresh slice of path traversal attack vectors for testing path sanitization logic. The returned cases include OS-appropria
internal/testutil/security_data.go:14
↓ 3 callers
Method
QuerySQL
(ctx context.Context, sql string)
internal/query/views.go:20
↓ 3 callers
Function
RebindPostgreSQL
RebindPostgreSQL converts `?` placeholders in query to PostgreSQL `$1, $2, ...` numbered placeholders. `?` inside single-quoted string literals is lef
internal/sqldialect/sqldialect.go:23
↓ 3 callers
Function
RegisterExtension
RegisterExtension enables the sqlite-vec extension process-wide and registers a "sqlite3_vec" driver variant of mattn/go-sqlite3. sqlite-vec exposes
internal/vector/sqlitevec/ext.go:46
↓ 3 callers
Function
RegisterViews
RegisterViews creates DuckDB views over the Parquet files in analyticsDir. Each view normalises types and supplies defaults for optional columns that
internal/query/views.go:135
↓ 3 callers
Function
ResolveAccounts
ResolveAccounts opens the Accounts4.sqlite database at dbPath and resolves the given GUIDs to account information. Returns a map of GUID → AccountInfo
internal/applemail/accounts.go:52
↓ 3 callers
Method
RetitleImessageChats
RetitleImessageChats refreshes generated titles on apple_messages conversations whose stored title is still based on raw phone/email handles but whose
internal/store/messages.go:1417
↓ 3 callers
Method
Search
Search runs hybrid or vector mode. Resolves the active generation via vector.ResolveActiveForFingerprint, so callers get the full family of sentinel e
internal/vector/hybrid/engine.go:102
↓ 3 callers
Function
SelectStableDriveFiles
(files []DriveFile, now time.Time, stableAfter time.Duration, imported map[string]string)
internal/synctechsms/drive.go:95
↓ 3 callers
Function
SetBackfillFTSBatchErrHookForTest
SetBackfillFTSBatchErrHookForTest installs (or, with nil, clears) the test-only hook that forces backfillFTSBatch to fail for a chosen id range. Tests
internal/store/export_test.go:18
↓ 3 callers
Method
SimulateScopeError
SimulateScopeError injects an insufficient scope error for a specific message ID.
internal/deletion/executor_test.go:244
↓ 3 callers
Function
StoragePath
StoragePath returns the content-addressed file path for an attachment: attachmentsDir/<hash[:2]>/<hash>. Returns an error if the content hash is inval
internal/export/attachments.go:231
↓ 3 callers
Function
StripHTML
StripHTML removes HTML tags, decodes entities, and normalizes whitespace. Block elements are converted to line breaks for readable plain text output.
internal/mime/parse.go:309
↓ 3 callers
Method
TextAggregate
TextAggregate aggregates text messages by the given view type.
internal/query/text_engine.go:15
↓ 3 callers
Method
TimeTruncExpression
TimeTruncExpression returns SQL to truncate a timestamp column to a given granularity ("year", "month", "day"). Used in GROUP BY for the Time aggregat
internal/query/dialect.go:32
↓ 3 callers
Function
TokenFilePath
TokenFilePath returns the token file path for an email within the given tokens directory. Use this when you need the path without a full Manager insta
internal/oauth/oauth.go:666
↓ 3 callers
Method
TokenSource
TokenSource returns an oauth2.TokenSource that impersonates the given user via domain-wide delegation. The returned source automatically handles JWT s
internal/oauth/serviceaccount.go:59
↓ 3 callers
Method
TryAcquire
TryAcquire attempts to acquire tokens without blocking. Returns true if successful, false if insufficient tokens.
internal/gmail/ratelimit.go:166
↓ 3 callers
Method
UndoDedup
UndoDedup restores soft-deleted duplicates from a dedup batch by clearing deleted_at and delete_batch_id. Merge side effects (labels copied to survivo
internal/store/dedup.go:360
↓ 3 callers
Function
V10AccountDir
V10AccountDir returns the path to a V10 account directory for the given GUID within mailDir. Searches V* directories from newest to oldest, preferring
internal/applemail/accounts.go:177
↓ 3 callers
Function
Validate
Validate scans the stream and returns an error if it doesn't look like an MBOX file. It reads up to maxBytes from the stream. This is a heuristic.
internal/mbox/reader.go:254
↓ 3 callers
Method
ValidateSecure
ValidateSecure returns an error if the server is configured insecurely without an explicit opt-in via allow_insecure.
internal/config/config.go:51
↓ 3 callers
Function
VectorIndexName
VectorIndexName returns the dimension-specific HNSW index name. Exposed mainly for diagnostic purposes.
internal/vector/pgvector/migrate.go:148
↓ 3 callers
Method
WithAccountFilter
(id *int64)
internal/tui/setup_test.go:187
↓ 3 callers
Method
WithAttrs
( attrs []slog.Attr, )
internal/logging/logging.go:381
↓ 3 callers
Method
WithMessage
WithMessage sets the error message.
internal/gmail/client_test.go:42
↓ 3 callers
Method
WithProgress
WithProgress sets the progress reporter.
internal/deletion/executor.go:75
↓ 3 callers
Function
WithRateLimiter
WithRateLimiter sets a custom rate limiter.
internal/gmail/client.go:57
↓ 3 callers
Method
WithSourceConversationID
(id string)
internal/testutil/builders.go:190
↓ 3 callers
Function
addCommonAggregateFlags
addCommonAggregateFlags adds shared flags to aggregate commands.
cmd/msgvault/cmd/output.go:51
↓ 3 callers
Method
aggregateTableView
aggregateTableView renders the aggregate data table.
internal/tui/view.go:284
↓ 3 callers
Function
applyDetailKey
applyDetailKey sends a key through handleMessageDetailKeys and returns the concrete Model.
internal/tui/setup_test.go:660
↓ 3 callers
Function
assertAllResults
assertAllResults verifies that every result satisfies the given predicate.
internal/query/sqlite_testhelpers_test.go:135
↓ 3 callers
Function
assertDescendingOrder
assertDescendingOrder verifies that aggregate results are sorted by count descending.
internal/query/testfixtures_test.go:635
↓ 3 callers
Function
assertFTSContains
assertFTSContains verifies that exactly wantCount messages match the given term through the SAME production search pipeline the app uses (Store.Search
internal/store/rebuild_fts_test.go:22
↓ 3 callers
Function
assertInlineSearchActive
assertInlineSearchActive checks the model's inlineSearchActive field.
internal/tui/setup_test.go:801
↓ 3 callers
Function
assertPermNoMoreThan
assertPermNoMoreThan checks that the file at path has permissions no more permissive than want. This is umask-tolerant: a umask of 0077 turning 0644 i
internal/fileutil/secure_test.go:16
↓ 3 callers
Function
assertRecipientCount
assertRecipientCount checks the count of recipients of a given type for a message.
internal/sync/testenv_test.go:202
↓ 3 callers
Function
assertSetEqual
assertSetEqual checks that got and want contain the same elements, ignoring order.
internal/query/duckdb_test.go:66
↓ 3 callers
Method
attachmentRowCount
()
internal/store/attachment_e2e_test.go:75
↓ 3 callers
Function
backupDatabase
backupDatabase writes a point-in-time consistent copy of the SQLite database to dst using VACUUM INTO. Unlike a file-system copy of the main/-wal/-shm
cmd/msgvault/cmd/deduplicate.go:545
↓ 3 callers
Method
batchGetRecipients
batchGetRecipients loads recipients for multiple messages in a single query.
internal/store/api.go:783
↓ 3 callers
Function
buildAPIClient
buildAPIClient creates the appropriate gmail.API client for the given source. saScopes is used when the resolved oauth_app is backed by a service acco
cmd/msgvault/cmd/syncfull.go:235
↓ 3 callers
Method
buildDetailLines
buildDetailLines constructs the lines for message detail view.
internal/tui/view.go:635
↓ 3 callers
Function
buildFilterQuery
buildFilterQuery builds query parameters for filter endpoints.
internal/remote/engine.go:242
↓ 3 callers
Function
buildPGFilterClauses
buildPGFilterClauses builds the list of SQL WHERE clauses (without leading "AND") that restrict a query to messages matching the structured filter. Ea
internal/vector/pgvector/filter.go:31
↓ 3 callers
Function
buildSearchQueryString
buildSearchQueryString reconstructs a search query string from a parsed Query. This is needed because the API expects the raw query string.
internal/remote/engine.go:765
↓ 3 callers
Function
byteToRune
byteToRune converts a byte offset into the rune index by binary searching runeByteOffsets. Faster than a linear scan when the offset is far from eithe
internal/vector/embed/chunk.go:220
↓ 3 callers
Function
chatTitle
chatTitle returns a display title for a chat for progress reporting.
internal/whatsapp/mapping.go:205
↓ 3 callers
Function
checkCache
checkCache checks if a valid cached update check exists. Returns (info, true) if a cached result should be used (either an update or no update). Retur
internal/update/update.go:662
↓ 3 callers
Method
checkRateLimit
checkRateLimit checks if a rate limit should be triggered. Must be called with mutex held.
internal/gmail/deletion_mock.go:166
↓ 3 callers
Method
claimOrInsertBuilding
claimOrInsertBuilding returns (id, isNew, err). isNew=true means this call inserted a fresh building row; isNew=false means we reused an existing buil
internal/vector/sqlitevec/backend.go:220
↓ 3 callers
Method
clearAllSelections
()
internal/tui/keys.go:1411
↓ 3 callers
Function
countSyncRuns
(t *testing.T, st *store.Store, sourceID int64)
cmd/msgvault/cmd/add_synctech_sms_drive_test.go:257
↓ 3 callers
Function
currentSchema
currentSchema returns the connection's first search_path schema, used to point the traced handle at the same per-test schema as the primary handle.
internal/vector/pgvector/review_fixes_test.go:155
↓ 3 callers
Method
deleteOne
deleteOne attempts to delete a single message and updates the local database on success. Returns resultSuccess (including 404/already-deleted), result
internal/deletion/executor.go:108
↓ 3 callers
Method
embedBatch
embedBatch fetches subject/body for ids, preprocesses each, calls the embedding client, and assembles the resulting chunks. Messages that vanished bet
internal/vector/embed/worker.go:562
↓ 3 callers
Method
ensureConversation
(sourceID int64, sourceConversationID, title string)
internal/synctechsms/importer.go:277
↓ 3 callers
Method
ensureNotifyChannel
ensureNotifyChannel lazily initializes timerNotify to prevent blocking on a nil channel if mockClock{} is instantiated directly without newMockClock()
internal/gmail/ratelimit_test.go:36
↓ 3 callers
Method
ensureParticipantsPhoneUniqueIndex
ensureParticipantsPhoneUniqueIndex upgrades legacy databases whose idx_participants_phone was created as a non-unique partial index before the schema
internal/store/migrate_phone_unique.go:28
↓ 3 callers
Method
ensureThreadCursorVisible
()
internal/tui/navigation.go:97
↓ 3 callers
Function
escapePath
escapePath normalizes a file path for use in DuckDB SQL strings.
internal/query/testfixtures_test.go:573
↓ 3 callers
Method
execerContains
execerContains reports whether the execer-level captures contain sub.
internal/vector/pgvector/review_fixes_test.go:113
↓ 3 callers
Method
executeSearchQuery
executeSearchQuery runs a search query built from conditions and the optional FTS join, returning paginated MessageSummary results. Shared by Search a
internal/query/sqlite.go:1573
↓ 3 callers
Function
extractTarGz
(archivePath, destDir string)
internal/update/update.go:396
↓ 3 callers
Function
extractZip
(archivePath, destDir string)
internal/update/update.go:498
↓ 3 callers
Function
fetchContentLength
fetchContentLength does a HEAD request and returns the Content-Length of the eventual asset (following redirects to the S3 backend). Returns 0 if the
internal/update/update.go:323
↓ 3 callers
Method
fetchLabelsForMessages
(ctx context.Context, messages []MessageSummary)
internal/query/sqlite.go:948
↓ 3 callers
Function
fetchLidMap
fetchLidMap reads the WhatsApp jid_map table to build a mapping from lid JID row IDs to their corresponding phone JIDs. The jid_map table links two ji
internal/whatsapp/queries.go:420
↓ 3 callers
Function
fetchTokenProfileEmail
( ctx context.Context, ts oauth2.TokenSource, profileURL string, email string, mode tokenProfileErrorMode
internal/oauth/oauth.go:678
↓ 3 callers
Method
fillScreen
fillScreen fills the remaining screen space with blank lines for table views.
internal/tui/view.go:734
↓ 3 callers
Method
fillScreenDetail
fillScreenDetail fills remaining space for detail view (uses detailPageSize).
internal/tui/view.go:739
↓ 3 callers
Function
formatArgsShape
formatArgsShape renders bound parameters as a redacted shape summary — type plus, where meaningful, length — without ever emitting the raw value. Stri
internal/store/db_logger.go:392
↓ 3 callers
Function
formatCount
formatCount formats a count as a human-readable string (e.g., "1.5K", "2.3M").
internal/tui/format.go:133
↓ 3 callers
Function
formatDeletedAt
(deletedAt *time.Time)
internal/api/handlers.go:1539
↓ 3 callers
Function
formatDisplayList
formatDisplayList converts a semicolon-separated PST display list to a comma-separated header value. PST DisplayTo/Cc/Bcc fields contain display names
internal/pst/mime.go:301
↓ 3 callers
Function
formatOptionalScore
(v float64)
cmd/msgvault/cmd/search_vector.go:414
↓ 3 callers
Function
formatQueryAddresses
(addrs []query.Address)
internal/api/handlers.go:1517
↓ 3 callers
Function
ftsTerms
ftsTerms turns a raw free-text query into the dialect-neutral term slice for the hybrid BM25 branch, mirroring the --mode fts path (Store.SearchMessag
internal/vector/hybrid/engine.go:224
↓ 3 callers
Function
genMessageCount
genMessageCount returns index_generations.message_count for a generation.
internal/vector/pgvector/backend_retire_test.go:53
↓ 3 callers
Function
generateAPIKey
()
cmd/msgvault/cmd/setup.go:229
↓ 3 callers
Function
getOnlySyncRun
(t *testing.T, st *store.Store, sourceID int64)
cmd/msgvault/cmd/add_synctech_sms_drive_test.go:265
↓ 3 callers
Method
getRecipients
Single-message helpers (still used by GetMessage for single PK lookups)
internal/store/api.go:869
↓ 3 callers
Method
handleModalKeys
(msg tea.KeyMsg)
internal/tui/keys.go:893
↓ 3 callers
Function
hasNumericOffset
hasNumericOffset returns true if the string contains a numeric timezone offset or Z (UTC). Named timezones like "MST" have platform-dependent behavior
internal/mime/parse.go:231
↓ 3 callers
Function
hasPathPrefix
hasPathPrefix checks if path is equal to or a child of dir. This prevents prefix attacks like tokensDir-evil matching tokensDir, and correctly handles
internal/oauth/oauth.go:540
↓ 3 callers
Function
hitMessageIDs
(hits []vector.Hit)
internal/vector/pgvector/backend_filter_test.go:126
↓ 3 callers
Function
hydrateHybridResults
hydrateHybridResults fetches subject, sender, and sent_at for each hit from the main DB, preserving the RRF ordering of the input hits. rebind conver
cmd/msgvault/cmd/search_vector.go:241
↓ 3 callers
Method
hydrateSyncRunStatus
(statusStore SourceStatusStore, status *SyncRunStatus)
internal/api/handlers.go:820
← previous
next →
1,001–1,100 of 5,225, ranked by callers