MCPcopy Index your code

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

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

↓ 10 callersFunctionsendMsg
sendMsg sends any tea.Msg through Update and returns the concrete Model.
internal/tui/setup_test.go:345
↓ 10 callersFunctionsetupTestManager
(t *testing.T, scopes []string)
internal/oauth/oauth_test.go:22
↓ 10 callersFunctionsourceOAuthApp
sourceOAuthApp extracts the oauth app name from a Source, returning "" for the default app.
cmd/msgvault/cmd/root.go:517
↓ 10 callersFunctiontruncate
Helper functions.
cmd/msgvault/cmd/deletions.go:728
↓ 9 callersMethodAttachmentPathsUniqueToSource
AttachmentPathsUniqueToSource returns storage_path values for attachments belonging to sourceID whose content_hash is not shared with any other source
internal/store/messages.go:1727
↓ 9 callersMethodBuildPtr
()
internal/testutil/builders.go:214
↓ 9 callersMethodEnsureLabels
EnsureLabels creates labels and returns a map of sourceLabelID → internal ID.
internal/testutil/storetest/storetest.go:66
↓ 9 callersMethodEnsureParticipantsBatch
EnsureParticipantsBatch gets or creates participants in batch. Returns a map of email -> participant ID.
internal/store/messages.go:385
↓ 9 callersFunctionExtractMboxFromZip
(zipPath, destDir string, log *slog.Logger)
internal/importer/mboxzip/mbox_zip.go:162
↓ 9 callersFunctionFuse
Fuse combines two ranked lists via Reciprocal Rank Fusion. - rrfK: standard RRF constant (60 is typical). - boost: >=1.0 multiplier appl
internal/vector/hybrid/rrf.go:24
↓ 9 callersMethodHasAnyConfig
HasAnyConfig returns true if any OAuth configuration exists (default or named apps).
internal/config/config.go:209
↓ 9 callersMethodIsAttachmentPathReferenced
IsAttachmentPathReferenced returns true if any attachment record still points to the given storage_path. Use this immediately before deleting a file t
internal/store/messages.go:1767
↓ 9 callersMethodIsMigrationApplied
IsMigrationApplied reports whether the named one-time data migration has already run.
internal/store/migrations.go:9
↓ 9 callersFunctionIsRemoteMode
IsRemoteMode returns true if commands should use remote server. Resolution order: 1. --local flag → always local 2. [remote].url set in config → use r
cmd/msgvault/cmd/store_resolver.go:100
↓ 9 callersFunctionMigrate
Migrate enables the pgvector extension and applies the embedding schema. Safe to run on every startup: every statement uses IF NOT EXISTS or its equiv
internal/vector/pgvector/migrate.go:41
↓ 9 callersMethodMustLookupParticipant
MustLookupParticipant returns the ID of the participant with the given email, failing the test if not found.
internal/testutil/dbtest/dbtest.go:135
↓ 9 callersFunctionNewMessageDetail
NewMessageDetail creates a builder with sensible defaults.
internal/testutil/builders.go:114
↓ 9 callersFunctionNewRateLimiter
NewRateLimiter creates a rate limiter with the specified QPS. A qps of 5 is the default safe rate for Gmail API. QPS is clamped to a minimum of MinQPS
internal/gmail/ratelimit.go:88
↓ 9 callersFunctionNewServiceAccountManager
NewServiceAccountManager creates a manager from a service account JSON key file.
internal/oauth/serviceaccount.go:23
↓ 9 callersFunctionParseFile
ParseFile reads a .vcf file and returns parsed contacts. Handles vCard 2.1 and 3.0 formats, including RFC 2425 line folding and QUOTED-PRINTABLE encod
internal/vcard/vcard.go:25
↓ 9 callersMethodPendingDir
PendingDir returns the path to the pending directory.
internal/deletion/manifest.go:247
↓ 9 callersMethodTokenSource
TokenSource returns a function that provides fresh access tokens. Suitable for passing to imap.WithTokenSource. The returned function is safe for conc
internal/microsoft/oauth.go:217
↓ 9 callersMethodUpdateSourceSyncCursor
UpdateSourceSyncCursor updates the sync cursor (historyId) for a source.
internal/store/sync.go:623
↓ 9 callersMethodWithAttachment
WithAttachment adds an attachment to the message.
internal/testutil/email/builder.go:107
↓ 9 callersMethodWithContextStats
(stats *query.TotalStats)
internal/tui/setup_test.go:225
↓ 9 callersMethodWithFromEmail
(e string)
internal/testutil/builders.go:32
↓ 9 callersMethodWithLogger
WithLogger sets the logger.
internal/sync/sync.go:90
↓ 9 callersFunctionassertAggregateCounts
assertAggregateCounts verifies that every key in want exists in got with the expected count, and that there are no extra rows.
internal/query/testfixtures_test.go:613
↓ 9 callersFunctionassertSelected
assertSelected checks that the given key is selected.
internal/tui/setup_test.go:588
↓ 9 callersFunctioncacheNeedsBuild
cacheNeedsBuild checks if the analytics cache needs to be built or updated. Collects all staleness signals before returning so that e.g. a mixed add+d
cmd/msgvault/cmd/tui.go:212
↓ 9 callersFunctionescapeLike
escapeLike escapes SQL LIKE special characters (%, _) so they are matched literally. The escaped string should be used with ESCAPE '\'.
internal/store/api.go:590
↓ 9 callersFunctionformatSize
(bytes int64)
cmd/msgvault/cmd/output.go:109
↓ 9 callersMethodhasCol
hasCol returns true if the named column exists in the Parquet schema for the given table.
internal/query/duckdb.go:252
↓ 9 callersFunctioninlineURL
inlineURL builds the inline endpoint URL for a given message ID and CID, URL-encoding the CID so values with reserved characters (including `/`) round
internal/api/handlers_test.go:2009
↓ 9 callersFunctioninsertPGGeneration
insertPGGeneration inserts an index_generations row with an explicit id and state so the test can control which generations are non-retired.
internal/vector/embed/enqueue_pg_test.go:70
↓ 9 callersFunctionlimitArg
limitArg extracts a non-negative integer limit from a map, with a default. JSON numbers arrive as float64. Clamps to maxLimit to prevent excessive res
internal/mcp/handlers.go:923
↓ 9 callersMethodloadToken
loadToken loads a saved token for the given email.
internal/oauth/oauth.go:386
↓ 9 callersFunctionmkMailbox
mkMailbox creates a mock legacy Apple Mail mailbox structure with a direct Messages/ subdirectory.
internal/emlx/discover_test.go:17
↓ 9 callersFunctionnormalizePhone
normalizePhone normalizes a WhatsApp JID user+server to an E.164 phone number. Input: user="447700900000", server="s.whatsapp.net" Output: "+447700900
internal/whatsapp/mapping.go:134
↓ 9 callersFunctionopenLoggedMem
openLoggedMem opens an in-memory sqlite DB wrapped by loggedDB.
internal/store/db_logger_test.go:35
↓ 9 callersFunctionopenPGTestDB
openPGTestDB connects to MSGVAULT_TEST_DB on its own per-test schema and applies the minimum main-schema scaffolding the backend's SELECT/JOIN paths e
internal/vector/pgvector/backend_testhelpers_test.go:44
↓ 9 callersFunctionpgPendingCount
(t *testing.T, db *sql.DB, gen int64)
internal/vector/embed/enqueue_pg_test.go:79
↓ 9 callersFunctionrequireAggregateRow
requireAggregateRow finds an AggregateRow by key or fails the test.
internal/query/duckdb_test.go:54
↓ 9 callersMethodresolveTokenEmail
resolveTokenEmail verifies the ID token and validates the authenticated email matches the expected address. Uses OIDC signature/issuer/audience valida
internal/microsoft/oauth.go:477
↓ 9 callersMethodsaveCheckpoint
saveCheckpoint persists the current execution progress to disk.
internal/deletion/executor.go:135
↓ 9 callersFunctionsetupVectorFeatures
setupVectorFeatures builds the vector backend, hybrid engine, embed worker, and enqueuer used by the serve daemon and the MCP command. The backend is
cmd/msgvault/cmd/serve_vector.go:37
↓ 9 callersFunctionstandardStats
standardStats returns a fresh stats object (1000 msgs, ~5MB, 50 attachments) for each call, preventing cross-test state leakage.
internal/tui/setup_test.go:447
↓ 9 callersFunctionviewTypePrefix
viewTypePrefix returns a short prefix for drill-down breadcrumbs (e.g., "S:" for Sender).
internal/tui/view.go:110
↓ 9 callersFunctionwriteEmbeddings
writeEmbeddings writes an OpenAI-compatible embeddings response using the provided vectors. It panics on encoding failure; that never happens for fixe
internal/vector/embed/client_test.go:19
↓ 8 callersMethodAdvance
Advance moves the clock forward and fires any pending timers.
internal/gmail/ratelimit_test.go:91
↓ 8 callersMethodApplyDefaults
ApplyDefaults fills in sensible defaults for any zero-valued fields. Called after TOML decode, before Validate.
internal/vector/config.go:290
↓ 8 callersMethodAssertRecipientCount
AssertRecipientCount asserts the number of recipients of a given type for a message.
internal/testutil/storetest/storetest.go:183
↓ 8 callersMethodAuthorize
(ctx context.Context, email string)
cmd/msgvault/cmd/root.go:417
↓ 8 callersMethodBuild
Build returns the constructed Manifest.
internal/deletion/manifest_test.go:98
↓ 8 callersFunctionBuildManifest
BuildManifest starts building a Manifest with sensible defaults. If no IDs are provided, defaults to {"id1", "id2"}.
internal/deletion/manifest_test.go:48
↓ 8 callersMethodCancelManifest
CancelManifest moves a pending or in-progress manifest to the cancelled directory and updates its inline Status field. Returns an error if the manifes
internal/deletion/manifest.go:382
↓ 8 callersMethodCreateManifest
CreateManifest creates a manifest with the given name and Gmail IDs.
internal/deletion/executor_test.go:88
↓ 8 callersMethodDeleteMessage
DeleteMessage permanently deletes a message.
internal/gmail/api.go:38
↓ 8 callersMethodGetBodyText
GetBodyText returns the best available body text. Prefers plain text, falls back to stripped HTML.
internal/mime/parse.go:353
↓ 8 callersMethodGetSourcesByIdentifier
GetSourcesByIdentifier returns all sources matching an identifier, regardless of source_type. Use this when the identifier may be shared across source
internal/store/sources.go:40
↓ 8 callersMethodGetStatsForScope
GetStatsForScope returns statistics scoped to the given source IDs. When sourceIDs is nil or empty, returns global counts. All message-derived counts
internal/store/store.go:815
↓ 8 callersMethodHasToken
(email string)
cmd/msgvault/cmd/root.go:416
↓ 8 callersMethodInspectMessage
InspectMessage retrieves detailed message information for test assertions. This consolidates multiple schema-aware queries into a single method, keepi
internal/store/inspect.go:36
↓ 8 callersMethodIsEmpty
IsEmpty reports whether the scope resolved to nothing.
cmd/msgvault/cmd/account_scope.go:19
↓ 8 callersMethodListAccounts
Account queries
internal/query/engine.go:77
↓ 8 callersFunctionLoadManifest
LoadManifest reads a manifest from a JSON file.
internal/deletion/manifest.go:131
↓ 8 callersMethodMarkDeletedByID
MarkDeletedByID marks a message as deleted by its internal ID.
internal/testutil/dbtest/dbtest.go:404
↓ 8 callersMethodMessageExistsBatch
MessageExistsBatch checks which message IDs already exist in the database. Returns a map of source_message_id -> internal message_id for existing mess
internal/store/messages.go:69
↓ 8 callersFunctionMkTempDir
MkTempDir creates a temporary directory with fallback logic for restricted environments (e.g. Windows where %TEMP% may be inaccessible due to permissi
internal/config/config.go:600
↓ 8 callersFunctionNew
New creates a new TUI model with the given options.
internal/tui/model.go:226
↓ 8 callersFunctionParse
Parse parses raw MIME data into a Message.
internal/mime/parse.go:54
↓ 8 callersFunctionParseE2EEJSONFile
ParseE2EEJSONFile parses a single E2EE flat-export JSON file and returns a populated Thread. rootDir is the export root (used for resolving media path
internal/fbmessenger/e2ee_parser.go:55
↓ 8 callersMethodRate
Rate returns the message-weighted rate in messages per second. Returns 0 when the window is empty so callers can treat 0 as "no estimate yet" and fall
cmd/msgvault/cmd/embed_progress.go:62
↓ 8 callersMethodSearchFastWithStats
SearchFastWithStats performs a fast metadata search and returns paginated results, total count, and aggregate stats in a single operation. The DuckDB
internal/query/engine.go:65
↓ 8 callersFunctionSecureChmod
SecureChmod changes the mode of the named file.
internal/fileutil/secure_unix.go:23
↓ 8 callersMethodSetOptions
SetOptions replaces the Syncer with one configured by the given modifier function.
internal/sync/testenv_test.go:75
↓ 8 callersFunctionSlug
Slug normalizes a Facebook display name into a deterministic ASCII slug usable as the local-part of a synthetic email address. Diacritics are stripped
internal/fbmessenger/slug.go:24
↓ 8 callersMethodStageForDeletion
StageForDeletion is a test helper that calls the controller's StageForDeletion method with sensible defaults, failing the test on error.
internal/tui/actions_test.go:58
↓ 8 callersMethodWalkFolders
WalkFolders walks all folders in the PST file recursively, building slash-separated folder paths. Search folders are skipped automatically. Returns th
internal/pst/reader.go:131
↓ 8 callersMethodWithAccounts
(accounts ...query.AccountInfo)
internal/tui/setup_test.go:136
↓ 8 callersFunctionassertNotSelected
assertNotSelected checks that the given key is not selected.
internal/tui/setup_test.go:594
↓ 8 callersFunctionassertViewFitsHeight
assertViewFitsHeight checks that the rendered view fits within the given height.
internal/tui/setup_test.go:681
↓ 8 callersFunctioncreateFakeParquet
createFakeParquet creates fake parquet files for all required directories to simulate a complete existing cache.
cmd/msgvault/cmd/build_cache_test.go:1261
↓ 8 callersFunctiongetAttr
getAttr returns the value of the named attribute, or empty string.
internal/gvoice/parser.go:442
↓ 8 callersFunctionhistoryLabelAdded
(id string, labels ...string)
internal/sync/testenv_test.go:307
↓ 8 callersFunctionint64Array
int64Array formats an int64 slice as the PostgreSQL array literal "{1,2,3}". Bound via $N::bigint[].
internal/vector/pgvector/backend.go:776
↓ 8 callersFunctionisPgError
isPgError checks if err is a pgconn.PgError with the given SQLSTATE code.
internal/store/dialect_pg.go:506
↓ 8 callersFunctionjoinRows
joinRows maps each item to a SQL row string and joins them with commas.
internal/query/testfixtures_test.go:307
↓ 8 callersMethodloadMessages
loadMessages fetches messages based on current filter (first page).
internal/tui/model.go:679
↓ 8 callersFunctionlogStmtWith
logStmtWith is the explicit form that lets callers add extra structured attributes (used by Exec to report rows_affected). On WARN-level lines (slow
internal/store/db_logger.go:341
↓ 8 callersFunctionnewRateWindow
newRateWindow constructs a ring buffer of the given capacity. A non-positive cap is normalized to 1 so callers can always Add and Rate without checkin
cmd/msgvault/cmd/embed_progress.go:27
↓ 8 callersFunctionnormalizeMCPHTTPAddr
normalizeMCPHTTPAddr canonicalises a --http argument and rejects values that would expose the unauthenticated MCP server on a non-loopback interface u
cmd/msgvault/cmd/mcp.go:182
↓ 8 callersFunctionpendingCount
pendingCount returns the number of pending_embeddings rows for a generation.
internal/vector/sqlitevec/backend_test.go:60
↓ 8 callersFunctionpgCountAvailable
pgCountAvailable returns the number of available (unclaimed) rows for the single building generation (id=1) that newPGQueueSchema seeds — the only gen
internal/vector/embed/queue_pg_test.go:97
↓ 8 callersMethodprocessBatch
processBatch processes a single batch of messages from a list response.
internal/sync/sync.go:162
↓ 8 callersMethodrequest
request makes an HTTP request with rate limiting and retry logic. bodyBytes can be nil for requests without a body.
internal/gmail/client.go:93
↓ 8 callersFunctionseedMessage
seedMessage inserts a message with the given subject and snippet, returning its ID. SentAt is left NULL so COALESCE returns NULL (avoids SQLite string
internal/store/api_test.go:52
↓ 8 callersMethodstate
state returns a snapshot of the limiter's refill rate and throttle deadline under the mutex.
internal/gmail/ratelimit_test.go:135
↓ 8 callersFunctionsupportPST
(t *testing.T)
internal/pst/reader_test.go:16
↓ 8 callersFunctiontimeToAppleTimestamp
timeToAppleTimestamp converts a time.Time to an Apple epoch timestamp. If useNano is true, returns nanoseconds; otherwise returns seconds.
internal/imessage/parser.go:36
← previousnext →401–500 of 5,225, ranked by callers