MCPcopy Create free account

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

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

↓ 8 callersFunctionwrapOAuthError
wrapOAuthError wraps an oauth/client-secrets error with setup instructions if the root cause is a missing or unreadable secrets file.
cmd/msgvault/cmd/root.go:393
↓ 8 callersFunctionwriteFile
(t *testing.T, path, body string)
internal/synctechsms/files_test.go:57
↓ 7 callersMethodAddPhoneParticipant
AddPhoneParticipant adds a phone-only participant (no email/domain) and returns its ID. Mirrors the iMessage/SMS shape: phone_number set, email_addres
internal/query/testfixtures_test.go:154
↓ 7 callersFunctionAddress
Address returns a deterministic synthetic mime.Address for the given Facebook display name. The name is preserved verbatim; the email local-part is Sl
internal/fbmessenger/slug.go:54
↓ 7 callersMethodAssertCompletedCount
AssertCompletedCount verifies the number of completed manifests.
internal/deletion/executor_test.go:142
↓ 7 callersMethodBuild
Build serializes the error to JSON bytes.
internal/gmail/client_test.go:72
↓ 7 callersMethodCountMessagesForSource
CountMessagesForSource returns the count of messages for a specific source (account).
internal/store/messages.go:866
↓ 7 callersFunctionCreateZip
CreateZip creates a zip archive at path containing the given entries.
internal/testutil/archive_helpers.go:57
↓ 7 callersMethodDisplayName
DisplayName returns a human-readable label for the scope.
cmd/msgvault/cmd/account_scope.go:40
↓ 7 callersMethodEffectiveAuthMethod
EffectiveAuthMethod returns the auth method, defaulting to password when the field is empty (backward compatibility with existing configs).
internal/imap/config.go:35
↓ 7 callersFunctionEncodedSamples
EncodedSamples returns a fresh copy of all encoded byte samples, safe for mutation by individual tests without cross-test coupling. MAINTAINER NOTE:
internal/testutil/encoding.go:120
↓ 7 callersMethodEnqueueMessages
EnqueueMessages adds the given IDs to pending_embeddings for every generation not in state 'retired'. Duplicate IDs are silently ignored via INSERT OR
internal/vector/embed/enqueue.go:108
↓ 7 callersMethodFingerprint
Fingerprint returns a stable, debuggable identifier for the effective preprocessing policy. Format: "p<ver>-<flags>" where ver is the preprocessVersio
internal/vector/config.go:159
↓ 7 callersFunctionGetEncodingByName
GetEncodingByName returns an encoding for the given IANA charset name.
internal/textutil/encoding.go:90
↓ 7 callersMethodGetMessageBySourceID
(ctx context.Context, sourceMessageID string)
internal/query/engine.go:28
↓ 7 callersMethodGetSourcesByIdentifierOrDisplayName
GetSourcesByIdentifierOrDisplayName returns all sources whose identifier or display_name matches the given value. This is the preferred single-query l
internal/store/sources.go:70
↓ 7 callersMethodImportPath
(path string)
internal/synctechsms/importer.go:31
↓ 7 callersMethodListPending
ListPending returns all pending deletion manifests.
internal/deletion/manifest.go:259
↓ 7 callersFunctionMakeSet
MakeSet builds a map[T]bool from the given items. Useful for constructing selection sets in tests.
internal/testutil/assert.go:5
↓ 7 callersMethodMarkMessageDeletedByGmailID
MarkMessageDeletedByGmailID marks a message as deleted by its Gmail ID. This is used by the deletion executor which only has the Gmail message ID. Whe
internal/store/messages.go:800
↓ 7 callersMethodMessageExistsWithRawBatch
MessageExistsWithRawBatch checks which message IDs already exist in the database and have raw MIME data stored. Returns a map of source_message_id ->
internal/store/messages.go:133
↓ 7 callersFunctionMustNotExist
MustNotExist fails the test if the path exists or if there's an error other than "not exist" (e.g., permission denied).
internal/testutil/fs_helpers.go:92
↓ 7 callersFunctionNewEnqueuer
NewEnqueuer returns an Enqueuer backed by the embeddings database (vectors.db on SQLite, the shared main DB on PostgreSQL). rebind and insertOrIgnore
internal/vector/embed/enqueue.go:89
↓ 7 callersFunctionNewGmailError
NewGmailError starts building a Gmail API error with the given HTTP status code.
internal/gmail/client_test.go:37
↓ 7 callersFunctionNewImporter
(st *store.Store, opts ImportOptions)
internal/synctechsms/importer.go:27
↓ 7 callersFunctionNewMessage
NewMessage creates a builder with sensible defaults. NewMessage creates a builder with sensible defaults. It uses a global counter to generate unique
internal/testutil/storetest/storetest.go:238
↓ 7 callersMethodOffset
Offset reports the current logical read offset (bytes consumed) within the underlying stream, accounting for buffered data.
internal/mbox/reader.go:95
↓ 7 callersFunctionParseHTMLThread
ParseHTMLThread parses a DYI HTML thread directory and returns a Thread.
internal/fbmessenger/html_parser.go:42
↓ 7 callersMethodSamples
Samples returns the number of valid entries currently in the window. Useful for the printer's "(last K)" annotation when the run hasn't yet emitted en
cmd/msgvault/cmd/embed_progress.go:57
↓ 7 callersMethodSearchFastCount
SearchFastCount returns the total count of messages matching a search query. This is used for pagination UI to show "N of M results".
internal/query/engine.go:55
↓ 7 callersMethodSimulateBatchDeleteError
SimulateBatchDeleteError sets the batch delete operation to fail.
internal/deletion/executor_test.go:189
↓ 7 callersMethodStart
Start begins executing scheduled jobs.
internal/scheduler/scheduler.go:267
↓ 7 callersMethodUpsertSourceImportItem
(item SourceImportItem)
internal/store/sync.go:451
↓ 7 callersMethodWhereClause
WhereClause renders an equality predicate of the form "LOWER(<column>) = LOWER(?)" for email-shaped identifiers and "<column> = ?" for everything else
internal/store/identifier_match.go:90
↓ 7 callersMethodWithBodyText
(s string)
internal/testutil/builders.go:154
↓ 7 callersMethodWithPageSizeRaw
WithPageSizeRaw sets pageSize without clamping, allowing zero/negative values for edge-case testing.
internal/tui/setup_test.go:171
↓ 7 callersMethodactivateInlineSearch
(placeholder string)
internal/tui/keys.go:1367
↓ 7 callersFunctionassertAggRows
assertAggRows verifies that aggregate rows contain the expected key/count pairs in the exact order given. This ensures both correctness and default so
internal/query/sqlite_testhelpers_test.go:113
↓ 7 callersFunctionassertDeletedFromSource
assertDeletedFromSource checks whether a message has deleted_from_source_at set.
internal/sync/testenv_test.go:218
↓ 7 callersFunctionassertListCount
assertListCount calls a list function and asserts the returned slice length.
internal/deletion/manifest_test.go:153
↓ 7 callersFunctionassertSelectionCount
assertSelectionCount checks the number of selected items.
internal/tui/setup_test.go:600
↓ 7 callersFunctioncallToolDirect
callToolDirect invokes a handler directly with the given arguments and returns the raw result.
internal/mcp/server_test.go:74
↓ 7 callersFunctioncreateTestManifest
createTestManifest creates a manifest via the manager with default IDs.
internal/deletion/manifest_test.go:33
↓ 7 callersMethoddoRequest
doRequest performs an authenticated HTTP GET request against the background context. The remote API is read-only, so every request is a body-less GET.
internal/remote/store.go:81
↓ 7 callersMethoddoRequestWithContext
doRequestWithContext performs an authenticated, body-less HTTP GET request with context support.
internal/remote/store.go:87
↓ 7 callersFunctionescapeSQLiteLike
escapeSQLiteLike escapes LIKE wildcard characters (%, _, \) with \.
internal/query/sqlite.go:120
↓ 7 callersFunctionfetchChats
fetchChats returns all non-hidden chats from the WhatsApp database. Joins with the jid table to get JID details for each chat. Handles old WhatsApp sc
internal/whatsapp/queries.go:69
↓ 7 callersFunctionfindLogLineByMsg
findLogLineByMsg is like findLogLine but returns nil rather than failing so callers can assert absence.
internal/store/db_logger_test.go:494
↓ 7 callersMethodfooterView
footerView renders the footer with keybindings.
internal/tui/view.go:951
↓ 7 callersFunctioninstallFromArchiveTo
installFromArchiveTo verifies the checksum, extracts the archive, and installs the binary to dstPath. It handles both .zip and .tar.gz archives. If pr
internal/update/update.go:156
↓ 7 callersFunctionisNetworkError
isNetworkError reports whether err indicates the underlying TCP connection was closed or timed out, meaning the IMAP session must be re-established.
internal/imap/client.go:516
↓ 7 callersMethodloadTextData
loadTextData dispatches the appropriate load command based on the current navigation level. Checking level (not just viewType) is necessary because dr
internal/tui/text_commands.go:144
↓ 7 callersMethodloadTokenFile
(email string)
internal/microsoft/oauth.go:645
↓ 7 callersFunctionnewEmptyBucketsEngine
newEmptyBucketsEngine creates a DuckDBEngine backed by Parquet test data that includes messages with empty senders, recipients, domains, and labels.
internal/query/duckdb_test.go:29
↓ 7 callersFunctionnewMockEngine
newMockEngine creates a querytest.MockEngine configured for TUI testing. The messages slice is returned from ListMessages, Search, SearchFast, and Sea
internal/tui/setup_test.go:60
↓ 7 callersFunctionnormalizeStmt
normalizeStmt collapses whitespace in a SQL statement and truncates it to maxChars (measured in runes, not bytes, so multi-byte UTF-8 in literals or c
internal/store/db_logger.go:442
↓ 7 callersFunctionpct
(n, total int)
scripts/mimeshootout/main.go:287
↓ 7 callersMethodreportProgress
(done, batchMsgs, batchChars int, batchElapsed time.Duration)
internal/vector/embed/worker.go:979
↓ 7 callersFunctionresolveRelative
resolveRelative makes a relative path absolute by joining it with base. Absolute paths and empty strings are returned unchanged.
internal/config/config.go:644
↓ 7 callersFunctionrunTool
runTool invokes a handler, asserts no error, and unmarshals the JSON result into T.
internal/mcp/server_test.go:93
↓ 7 callersFunctionsaveMboxCheckpoint
(st *store.Store, syncID int64, file string, offset int64, seq int64, cp *store.Checkpoint)
internal/importer/mbox_import.go:516
↓ 7 callersFunctionscanSource
(sc scanner)
internal/store/sync.go:77
↓ 7 callersFunctionsetupDeletionMockTest
(t *testing.T)
internal/gmail/deletion_mock_test.go:12
↓ 7 callersFunctionsetupScopeFixture
setupScopeFixture creates a store with one source and one collection for resolver tests. Returns the store, source identifier, and collection name.
cmd/msgvault/cmd/account_scope_test.go:13
↓ 7 callersFunctionskipUnlessPostgres
skipUnlessPostgres skips the calling test unless MSGVAULT_TEST_DB points at PostgreSQL. The tsvector 1MB limit and its body cap are PostgreSQL-only —
internal/store/pg_fts_bodycap_test.go:19
↓ 7 callersMethodstartSpinner
startSpinner returns a spinnerTick command if the spinner isn't already active, and marks it as active. Call this when loading begins.
internal/tui/model.go:821
↓ 7 callersFunctionstartSyncRun
(t *testing.T, env *TestEnv, sourceID int64)
internal/sync/testenv_test.go:117
↓ 7 callersFunctionwriteQP
writeQP writes s as quoted-printable text to dst. Lines longer than 76 characters are soft-wrapped with "=\r\n". Trailing whitespace before line break
internal/pst/mime.go:316
↓ 7 callersFunctionwriteSyncState
writeSyncState writes a _last_sync.json file to the analytics directory.
cmd/msgvault/cmd/build_cache_test.go:1244
↓ 7 callersFunctionwriteTestToken
writeTestToken writes a fake token file for the test account.
cmd/msgvault/cmd/export_token_test.go:128
↓ 6 callersMethodAddAttachment
AddAttachment adds an attachment row and sets HasAttachments on the related message.
internal/query/testfixtures_test.go:277
↓ 6 callersMethodAuthorize
(ctx context.Context, email string)
internal/microsoft/oauth.go:150
↓ 6 callersMethodBindValue
BindValue returns the value to bind for the placeholder in WhereClause. Equal to the raw input — case-folding happens in SQL via LOWER, not in Go, so
internal/store/identifier_match.go:100
↓ 6 callersMethodBuild
Build returns the constructed Message.
internal/testutil/storetest/storetest.go:313
↓ 6 callersFunctionBuildRFC5322
BuildRFC5322 constructs raw RFC 5322/MIME bytes from a MessageEntry and its attachments. Strategy: 1. If TransportHeaders is non-empty, use those ver
internal/pst/mime.go:26
↓ 6 callersMethodClone
Clone returns a deep copy of the MessageFilter. This is necessary because EmptyValueTargets is a map, and a simple struct copy would share the underly
internal/query/models.go:286
↓ 6 callersMethodClose
Close checkpoints the WAL (unless read-only) and closes the database.
internal/store/store.go:345
↓ 6 callersMethodCollapseWhitespaceEnabled
CollapseWhitespaceEnabled returns the effective collapse_whitespace setting. Defaults to true when the field is unset — HTML→text conversion routinely
internal/vector/config.go:144
↓ 6 callersMethodCountSyncRunItems
(syncRunID int64, status string)
internal/api/server.go:42
↓ 6 callersFunctionCreateExclusiveFile
CreateExclusiveFile atomically creates a file that doesn't already exist, trying path, path_1, path_2, etc. on conflict. Returns the open file and the
internal/export/attachments.go:326
↓ 6 callersMethodCreateManifest
CreateManifest creates and saves a new manifest.
internal/deletion/manifest.go:406
↓ 6 callersFunctionDefaultOptions
DefaultOptions returns sensible defaults.
internal/sync/sync.go:57
↓ 6 callersMethodDelete
(ctx context.Context, gen GenerationID, messageIDs []int64)
internal/vector/backend.go:170
↓ 6 callersMethodEnsureDefaultCollection
EnsureDefaultCollection creates the auto-managed default collection if it doesn't exist and adds all current sources to it. Safe to call on every sche
internal/store/collection.go:56
↓ 6 callersMethodExecute
Execute runs the executor with default options.
internal/deletion/executor_test.go:96
↓ 6 callersMethodExportAttachments
ExportAttachments performs the export logic.
internal/tui/actions.go:210
↓ 6 callersMethodFull
Full performs a full synchronization.
internal/sync/sync.go:275
↓ 6 callersFunctionHasCompleteParquetData
HasCompleteParquetData checks that all required parquet tables exist. Use this instead of HasParquetData when enabling DuckDB, since DuckDB unconditio
internal/query/duckdb.go:1956
↓ 6 callersMethodIsBusyError
IsBusyError reports whether err indicates write contention that a bounded retry loop should treat as "retry later". The SQLSTATEs covered: - 55P03 (l
internal/store/dialect_pg.go:417
↓ 6 callersMethodMoveManifest
MoveManifest moves a manifest from one status directory to another.
internal/deletion/manifest.go:346
↓ 6 callersFunctionMustExist
MustExist fails the test if the path does not exist or cannot be accessed.
internal/testutil/fs_helpers.go:83
↓ 6 callersFunctionNewDeletionMockAPI
NewDeletionMockAPI creates a new deletion mock with empty state.
internal/gmail/deletion_mock.go:64
↓ 6 callersFunctionNewExecutor
NewExecutor creates a deletion executor.
internal/deletion/executor.go:58
↓ 6 callersFunctionNewTestDB
NewTestDB creates an in-memory SQLite database with the production schema loaded. schemaPath is the path to schema.sql (e.g. "../store/schema.sql" fro
internal/testutil/dbtest/dbtest.go:31
↓ 6 callersFunctionParseFromSeparatorDateStrict
ParseFromSeparatorDateStrict parses the ctime-like date portion of an mbox "From " separator line, but only accepts numeric offsets or a small allowli
internal/mbox/from_separator_date.go:229
↓ 6 callersMethodPersistMessage
PersistMessage atomically stores a message plus its body, raw MIME, recipients, and labels in a single transaction. Returns the message ID.
internal/store/messages.go:313
↓ 6 callersMethodRecordSyncRunItem
RecordSyncRunItem records a per-item sync outcome for diagnostics.
internal/store/sync.go:283
↓ 6 callersMethodRemoveSource
RemoveSource deletes a source and all its associated data. FTS5 rows are cleaned up explicitly (no FK cascade for virtual tables). CASCADE handles con
internal/store/sources.go:135
↓ 6 callersMethodRemoveSourceSerialized
RemoveSourceSerialized deletes a source while holding an exclusive write lock, and reports whether any sync was running at the moment the lock was acq
internal/store/sources.go:151
↓ 6 callersMethodSanitizeFTSQuery
SanitizeFTSQuery builds a tsquery arg from a single user string using the allowlist tokenizer sqldialect.EscapeTSQueryTerm: the input is split on ever
internal/query/dialect.go:235
← previousnext →501–600 of 5,225, ranked by callers