MCPcopy Index your code

hub / github.com/kenn-io/msgvault / functions

Functions5,225 in github.com/kenn-io/msgvault

↓ 12 callersFunctionDiscover
Discover walks a DYI export root and returns one ThreadDir per thread directory found, sorted by (Section, Name). Absolute and relative root inputs yi
internal/fbmessenger/discover.go:53
↓ 12 callersMethodExecuteBatch
ExecuteBatch runs the batch executor.
internal/deletion/executor_test.go:106
↓ 12 callersMethodGetCollectionByName
GetCollectionByName returns the collection with the given name and its member source IDs.
internal/store/collection.go:164
↓ 12 callersMethodGetManifest
GetManifest loads a manifest by ID from any status directory.
internal/deletion/manifest.go:316
↓ 12 callersMethodIncremental
Incremental performs an incremental sync using the Gmail History API. Falls back to full sync if history is too old (404 error). The caller must reso
internal/sync/incremental.go:21
↓ 12 callersMethodInsertOrIgnore
InsertOrIgnore rewrites a complete INSERT statement to silently ignore conflicts. SQLite: INSERT OR IGNORE INTO ... PostgreSQL: INSERT INTO ... ON CO
internal/store/dialect.go:46
↓ 12 callersMethodMigrateLegacyIdentityConfig
MigrateLegacyIdentityConfig migrates a list of legacy global identity addresses into per-account confirmed records. It runs at most once: subsequent c
internal/store/migrate_legacy_identity.go:34
↓ 12 callersFunctionNewMessageSummary
NewMessageSummary creates a builder with sensible defaults.
internal/testutil/builders.go:15
↓ 12 callersFunctionParseJSONThread
ParseJSONThread parses every message_*.json file in a DYI thread directory and returns a populated Thread. rootDir is the DYI export root; threadDir i
internal/fbmessenger/json_parser.go:69
↓ 12 callersFunctionResolveAccountFlag
ResolveAccountFlag resolves the value of an --account flag. It rejects collection names with a hint to use --collection.
cmd/msgvault/cmd/account_scope.go:52
↓ 12 callersFunctionResolveMboxExport
(exportPath string, importsDir string, log *slog.Logger)
internal/importer/mboxzip/mbox_zip.go:37
↓ 12 callersMethodSetEmbedJob
SetEmbedJob registers the embed job on a cron schedule. If schedule is empty, no cron entry is created (the job can still fire via the post-sync hook
internal/scheduler/scheduler.go:213
↓ 12 callersMethodSourceIDs
SourceIDs returns the source IDs that this scope expands to.
cmd/msgvault/cmd/account_scope.go:29
↓ 12 callersMethodUpdateSourceOAuthApp
UpdateSourceOAuthApp updates the OAuth app binding for a source. Pass a null NullString to clear the binding (use default app).
internal/store/sources_oauthapp.go:10
↓ 12 callersMethodWithDetail
(detail *query.MessageDetail)
internal/tui/setup_test.go:126
↓ 12 callersFunctionapplyMessageListKeyWithCmd
applyMessageListKeyWithCmd sends a key through handleMessageListKeys and returns Model and Cmd.
internal/tui/setup_test.go:646
↓ 12 callersFunctionapplySearchResults
applySearchResults simulates the arrival of search results via Update.
internal/tui/setup_test.go:721
↓ 12 callersFunctionassertContextStats
assertContextStats checks contextStats fields. Use -1 for size or attachments to skip that check.
internal/tui/setup_test.go:759
↓ 12 callersFunctioncaptureSlog
captureSlog installs a JSON handler over buf as the default slog logger at debug level for the duration of a test. Returns a cleanup closure that rest
internal/store/db_logger_test.go:23
↓ 12 callersFunctioncountViewLines
----------------------------------------------------------------------------- View Fit Helpers - centralize line counting and resize logic -----------
internal/tui/setup_test.go:671
↓ 12 callersFunctioncreateTestSourceDB
createTestSourceDB creates a source database with schema and test data. Returns the path to the database.
internal/store/subset_test.go:17
↓ 12 callersMethodexport
export validates inputs, reads the local token, uploads it to the remote server, and registers the account.
cmd/msgvault/cmd/export_token.go:81
↓ 12 callersFunctionkeyDown
keyDown returns a KeyMsg for the Down arrow key.
internal/tui/setup_test.go:529
↓ 12 callersFunctionmakeIDToken
makeIDToken builds a minimal unsigned JWT with the given claims. Used in tests with verifyIDTokenFn to bypass OIDC signature validation.
internal/microsoft/oauth_test.go:165
↓ 12 callersFunctionmkMailboxDir
mkMailboxDir creates an Apple Mail mailbox directory with .emlx files.
internal/importer/emlx_import_test.go:28
↓ 12 callersFunctionnewTestStore
newTestStore creates a Store pointing at the given httptest server.
internal/remote/store_test.go:87
↓ 12 callersFunctionopenStoreAndInit
()
cmd/msgvault/cmd/import_imessage.go:249
↓ 12 callersFunctionpickEmbedGeneration
pickEmbedGeneration resolves which generation this embed run should target. Returns (gen, rebuildInProgress, err): - FullRebuild: prompt for confirma
cmd/msgvault/cmd/embed_vector.go:204
↓ 12 callersFunctionrebuildCacheAfterWrite
rebuildCacheAfterWrite rebuilds the analytics cache after a write operation. Uses the staleness check to determine whether a full rebuild (deletions/m
cmd/msgvault/cmd/build_cache.go:814
↓ 12 callersMethodrecordSyncItem
(syncID int64, sourceMessageID, phase, status, kind string, err error)
internal/sync/item_errors.go:68
↓ 12 callersMethodrenderInfoLine
renderInfoLine renders the info/notification line with optional right-aligned loading spinner. Used on the second-to-last line of table views (before
internal/tui/view.go:1096
↓ 11 callersMethodActiveGeneration
ActiveGeneration returns the current active generation, or ErrNoActiveGeneration if none exists.
internal/vector/backend.go:165
↓ 11 callersMethodAddMessageLabels
AddMessageLabels adds labels to a message without removing existing ones. Uses INSERT OR IGNORE to skip labels that already exist.
internal/store/messages.go:729
↓ 11 callersMethodAnalyticsDir
AnalyticsDir returns the path to the Parquet analytics directory.
internal/config/config.go:454
↓ 11 callersMethodBuildingGeneration
(ctx context.Context)
internal/vector/backend.go:166
↓ 11 callersMethodClose
Close releases DuckDB resources, including any cached search temp table.
internal/query/duckdb.go:179
↓ 11 callersMethodEnqueueMessages
(ctx context.Context, messageIDs []int64)
internal/sync/sync.go:28
↓ 11 callersFunctionImportPst
128 MiB ImportPst imports all email messages from a PST file into the msgvault database. Folder structure is preserved as labels. Non-email items (ca
internal/importer/pst_import.go:99
↓ 11 callersMethodSaveManifest
SaveManifest saves a manifest to the appropriate directory based on status.
internal/deletion/manifest.go:330
↓ 11 callersMethodServiceAccountKeyFor
ServiceAccountKeyFor returns the service account key path for the given app name. Empty name returns the default. Non-empty name looks up Apps[name].
internal/config/config.go:197
↓ 11 callersMethodStatus
()
internal/api/server.go:54
↓ 11 callersMethodWithStats
(stats *query.TotalStats)
internal/tui/setup_test.go:220
↓ 11 callersMethodactivations
()
internal/scheduler/scheduler_test.go:446
↓ 11 callersFunctionassertModal
assertModal checks that the model is in the expected modal state.
internal/tui/setup_test.go:362
↓ 11 callersFunctionconfirmDestructive
confirmDestructive prompts on the provided writer and reads a single line of input from the provided reader. Returns (true, nil) on confirmation, (fal
cmd/msgvault/cmd/confirm.go:43
↓ 11 callersFunctioncountAvailable
countAvailable returns the number of rows for gen whose claimed_at IS NULL (i.e. available to be claimed).
internal/vector/embed/testsupport_test.go:47
↓ 11 callersFunctioncountPendingRows
countPendingRows returns the number of pending_embeddings rows belonging to a generation. Used by the retire-cleans-pending tests (cr2-2/cr2-3/cr2-4).
internal/vector/pgvector/backend_retire_test.go:28
↓ 11 callersMethoddetailPageSize
detailPageSize returns the page size for detail view (2 more than table views).
internal/tui/model.go:1362
↓ 11 callersFunctionexpandPath
expandPath expands ~ to the user's home directory. Only expands paths that are exactly "~" or start with "~/". It also strips surrounding single or do
internal/config/config.go:655
↓ 11 callersFunctionformatBytes
formatBytes formats a byte count as a human-readable string (e.g., "1.5 KB").
internal/tui/format.go:116
↓ 11 callersMethodhasFTSTable
hasFTSTable checks if the FTS index is available for this dialect. Result is cached after first successful check. Errors cause retries on next call. T
internal/query/sqlite.go:47
↓ 11 callersFunctionjsonResult
(v any)
internal/mcp/handlers.go:937
↓ 11 callersFunctionnewEngineFixture
(t *testing.T)
internal/vector/hybrid/engine_test.go:44
↓ 11 callersFunctionnewFilterTestDB
(t *testing.T)
internal/vector/hybrid/filter_test.go:16
↓ 11 callersFunctionnewTestEnv
(t *testing.T, gmailIDs ...string)
internal/tui/actions_test.go:40
↓ 11 callersFunctionopenStderrSink
openStderrSink returns a *os.File pointing at /dev/null so pickEmbedGeneration's status prints do not clutter test output.
cmd/msgvault/cmd/embed_vector_test.go:57
↓ 11 callersFunctionresetSearchFlags
()
cmd/msgvault/cmd/search_test.go:50
↓ 11 callersFunctionsafeCmdWithPanic
safeCmdWithPanic wraps an async operation with panic recovery. The errMsg function converts a panic value into the appropriate message type. This elim
internal/tui/model.go:28
↓ 11 callersFunctionthreadDir
(t *testing.T, root, name string)
internal/fbmessenger/json_parser_test.go:12
↓ 11 callersFunctionwriteHeader
(buf *bytes.Buffer, name, value string)
internal/pst/mime.go:235
↓ 10 callersMethodClientSecretsFor
ClientSecretsFor returns the client secrets path for the given app name. Empty name returns the default. Non-empty name looks up Apps[name].
internal/config/config.go:174
↓ 10 callersFunctionCollectStats
CollectStats assembles a StatsView for the stats endpoints. Returns (nil, nil) when the backend is nil (vector search disabled); callers can attach th
internal/vector/stats.go:78
↓ 10 callersMethodDatabasePath
DatabasePath returns the on-disk SQLite filesystem path for backup operations (VACUUM INTO, copies). It accepts the plain filesystem path and the SQLi
internal/config/config.go:405
↓ 10 callersMethodEnsureLabelsBatch
EnsureLabelsBatch ensures all labels exist and returns a map of source_label_id -> internal ID. Runs in a single transaction with a two-phase rename t
internal/store/messages.go:632
↓ 10 callersMethodError
()
internal/export/attachments.go:135
↓ 10 callersMethodFatalf
(format string, args ...any)
internal/testutil/tbmock/mock_tb.go:35
↓ 10 callersMethodIdentifier
Identifier returns a canonical string like "imaps://user@host:port". The scheme encodes the transport mode: imaps (TLS), imap+starttls (STARTTLS), or
internal/imap/config.go:58
↓ 10 callersMethodMergeDuplicates
( survivorID int64, duplicateIDs []int64, batchID string, )
internal/store/dedup.go:179
↓ 10 callersFunctionMergeFilterIntoQuery
MergeFilterIntoQuery combines a MessageFilter context with a search.Query. Context filters are appended to existing query filters. Note on semantics:
internal/query/sqlite.go:1682
↓ 10 callersFunctionMigrate
Migrate runs the baseline schema and ensures a vec0 virtual table for `defaultDim` exists. Safe to run on every startup. PRAGMA foreign_keys is appli
internal/vector/sqlitevec/migrate.go:21
↓ 10 callersMethodNeedsFTSBackfill
NeedsFTSBackfill reports whether the FTS index needs to be populated.
internal/store/store.go:787
↓ 10 callersFunctionNew
New creates a new remote store.
internal/remote/store.go:34
↓ 10 callersFunctionNew
New creates a new Syncer.
internal/sync/sync.go:75
↓ 10 callersFunctionNewReader
NewReader creates a new MBOX reader.
internal/mbox/reader.go:63
↓ 10 callersFunctionNormalizePhone
NormalizePhone normalizes a phone number to E.164 format. Returns an error for inputs that are not phone numbers (emails, short codes, system identifi
internal/textimport/phone.go:13
↓ 10 callersMethodRecomputeConversationStats
RecomputeConversationStats updates the denormalized stats columns on all conversations belonging to the given source. It recomputes message_count, par
internal/store/messages.go:1190
↓ 10 callersFunctionRegisterExtension
RegisterExtension reports that sqlite-vec is unavailable in this build.
internal/vector/sqlitevec/ext_stub.go:21
↓ 10 callersFunctionResolveActiveForFingerprint
ResolveActiveForFingerprint returns the active generation if its fingerprint matches the supplied one. Production callers pass Config.GenerationFinger
internal/vector/generations.go:26
↓ 10 callersFunctionResolveCollectionFlag
ResolveCollectionFlag resolves the value of a --collection flag. It rejects account identifiers with a hint to use --account.
cmd/msgvault/cmd/account_scope.go:104
↓ 10 callersMethodSave
Save writes the manifest to a JSON file.
internal/deletion/manifest.go:146
↓ 10 callersMethodSearchMessagesQuery
(q *search.Query, offset, limit int)
internal/api/server.go:32
↓ 10 callersFunctionSecureMkdirAll
SecureMkdirAll creates a directory path and all parents that do not yet exist.
internal/fileutil/secure_unix.go:18
↓ 10 callersMethodSetEmptyAttachments
SetEmptyAttachments marks the attachments table as empty (schema only).
internal/query/testfixtures_test.go:294
↓ 10 callersMethodThrottle
Throttle temporarily reduces the rate when we hit API rate limits. This provides adaptive back-pressure when Gmail returns 429/403 quota errors.
internal/gmail/ratelimit.go:215
↓ 10 callersMethodTokenSource
(ctx context.Context, email string)
cmd/msgvault/cmd/root.go:415
↓ 10 callersMethodTrashMessage
TrashMessage moves a message to trash (recoverable for 30 days).
internal/gmail/api.go:35
↓ 10 callersMethodWithSnippet
(s string)
internal/testutil/builders.go:195
↓ 10 callersFunctionatoi
(s string)
internal/synctechsms/parser.go:287
↓ 10 callersMethodclampDetailScroll
clampDetailScroll ensures detailScroll stays within valid bounds.
internal/tui/model.go:1367
↓ 10 callersFunctiongenState
genState returns the index_generations.state for a generation.
internal/vector/pgvector/backend_retire_test.go:124
↓ 10 callersFunctiongetDateArg
getDateArg extracts an optional date (YYYY-MM-DD) from the arguments map.
internal/mcp/handlers.go:166
↓ 10 callersMethodheaderView
headerView renders a two-level header: Line 1: msgvault [version] - account Line 2: breadcrumb | stats.
internal/tui/view.go:268
↓ 10 callersFunctionnewTestModelAtLevel
newTestModelAtLevel creates a test model at the specified navigation level. This helper uses the TestModelBuilder internally for consistency.
internal/tui/setup_test.go:463
↓ 10 callersFunctionopenTestBackend
openTestBackend opens a fresh in-memory-ish sqlitevec backend with a single pre-seeded message so CreateGeneration has something to enqueue.
cmd/msgvault/cmd/embed_vector_test.go:24
↓ 10 callersMethodparquetPath
parquetPath returns the path pattern for a specific Parquet table.
internal/query/duckdb.go:239
↓ 10 callersMethodqueryRowContext
queryRowContext runs QueryRowContext with dialect-aware placeholder rebinding.
internal/query/sqlite.go:115
↓ 10 callersMethodrecordCall
recordCall records a call to the sequence log. Must be called with mutex held.
internal/gmail/deletion_mock.go:182
↓ 10 callersMethodrenderView
renderView renders the current view based on the active level. Separated from View() so transitions can capture the current output before changing sta
internal/tui/model.go:1522
↓ 10 callersMethodrunMaintenance
runMaintenance runs fn inside a single transaction with the per-statement execution timeout disabled (finding S1). It is the one chokepoint for mainte
internal/store/store.go:488
↓ 10 callersMethodselectMailbox
selectMailbox selects a mailbox if not already selected. Caller must hold mu.
internal/imap/client.go:182
← previousnext →301–400 of 5,225, ranked by callers