MCPcopy Create free account

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

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

↓ 4 callersFunctionDefaultHome
DefaultHome returns the default msgvault home directory. Respects MSGVAULT_HOME environment variable and expands ~ in its value.
internal/config/config.go:243
↓ 4 callersMethodDeleteAllDeduped
DeleteAllDeduped permanently deletes every dedup-hidden row regardless of batch. Returns the number of rows deleted and the number of distinct batches
internal/store/dedup.go:413
↓ 4 callersMethodDeleteCollection
DeleteCollection drops the collection. Sources and messages untouched. Rejects deletion of the auto-managed default collection.
internal/store/collection.go:290
↓ 4 callersMethodDeleteDedupedBatch
DeleteDedupedBatch permanently deletes all hidden rows associated with a dedup batch. Only deletes rows where deleted_at IS NOT NULL AND delete_batch_
internal/store/dedup.go:379
↓ 4 callersMethodDeleteToken
DeleteToken revokes the refresh token at Microsoft (best-effort) and removes the local token file. Revocation failures are logged but do not prevent l
internal/microsoft/oauth.go:667
↓ 4 callersFunctionDiscoverBackupFiles
(path string)
internal/synctechsms/files.go:24
↓ 4 callersFunctionDriverName
DriverName returns the driver name to pass to sql.Open.
internal/vector/sqlitevec/ext.go:62
↓ 4 callersMethodEnsureParticipantByIdentifier
(identifierType, identifierValue, displayName string)
internal/store/messages.go:1299
↓ 4 callersFunctionFormatSize
FormatSize formats bytes as a human-readable string.
internal/update/update.go:811
↓ 4 callersMethodGetAccountSchedule
GetAccountSchedule returns the schedule for a specific account email. Returns nil if the account is not configured for scheduling. The returned value
internal/config/config.go:559
↓ 4 callersMethodGetLatestSync
(sourceID int64)
internal/api/server.go:40
↓ 4 callersMethodGetMessage
GetMessage retrieves a full message from SQLite. Uses direct SQLite connection when available for better BLOB handling.
internal/query/duckdb.go:1509
↓ 4 callersMethodGetMessageBody
GetMessageBody returns the body_text and body_html for a message.
internal/testutil/storetest/storetest.go:117
↓ 4 callersMethodGetMessageSummariesByIDs
GetMessageSummariesByIDs returns summary-level rows (no body, no raw MIME) for the supplied IDs in the same order as ids. Missing IDs are silently dro
internal/query/engine.go:42
↓ 4 callersMethodGetProfile
GetProfile returns the authenticated user's profile.
internal/gmail/api.go:9
↓ 4 callersMethodGetSourceImportItem
(sourceID int64, provider, providerID string)
internal/store/sync.go:477
↓ 4 callersMethodGetTextStats
GetTextStats returns aggregate stats for text messages.
internal/query/text_engine.go:27
↓ 4 callersMethodHasToken
(email string)
internal/microsoft/oauth.go:658
↓ 4 callersFunctionIngestRawMessage
IngestRawMessage parses and stores a raw MIME message into the database. This is the shared ingestion path for all importers (mbox, emlx, etc.). Para
internal/importer/ingest.go:30
↓ 4 callersMethodInspectParticipantDisplayName
InspectParticipantDisplayName returns the display_name from the participants table for an email.
internal/store/inspect.go:156
↓ 4 callersMethodIsBusyError
IsBusyError returns true if the error indicates the database is held by another connection, either busy (SQLITE_BUSY) or locked (SQLITE_LOCKED). Used
internal/store/dialect.go:194
↓ 4 callersMethodIsEmpty
IsEmpty reports whether the filter has no restrictions. A zero-value Filter is empty and backends should skip filter resolution entirely.
internal/vector/backend.go:101
↓ 4 callersMethodListImportedSourceItemChecksums
(sourceID int64, provider string)
internal/store/sync.go:500
↓ 4 callersMethodListInProgress
ListInProgress returns all in-progress deletion manifests.
internal/deletion/manifest.go:264
↓ 4 callersMethodMarkMessageDeleted
MarkMessageDeleted marks a message as deleted from the source.
internal/store/messages.go:767
↓ 4 callersMethodMarkMessagesDeletedBatch
MarkMessagesDeletedBatch marks multiple messages as deleted from the source in a single transaction.
internal/store/messages.go:777
↓ 4 callersMethodMarkMigrationApplied
MarkMigrationApplied records that a migration has run. Idempotent.
internal/store/migrations.go:21
↓ 4 callersFunctionNewClient
NewClient creates a new Gmail API client.
internal/gmail/client.go:64
↓ 4 callersFunctionNewManager
(clientID, tenantID, tokensDir string, logger *slog.Logger)
internal/microsoft/oauth.go:119
↓ 4 callersFunctionNewRateLimiter
NewRateLimiter creates a new rate limiter. rps is requests per second, burst is the maximum burst size.
internal/api/middleware.go:92
↓ 4 callersFunctionNewReaderWithMaxMessageBytes
NewReaderWithMaxMessageBytes creates a new MBOX reader that rejects messages larger than maxMessageBytes. If maxMessageBytes <= 0, no limit is enforce
internal/mbox/reader.go:81
↓ 4 callersFunctionNormalizeAddress
(raw string)
internal/textimport/phone.go:86
↓ 4 callersMethodRead
(p []byte)
cmd/msgvault/cmd/repair_encoding.go:686
↓ 4 callersMethodReclaimStale
ReclaimStale clears the claim on any pending row whose claimed_at is older than olderThan. Returns the number of rows reclaimed.
internal/vector/embed/queue.go:264
↓ 4 callersMethodSearchByDomains
SearchByDomains returns messages where any participant (from, to, cc, or bcc) belongs to one of the given domains.
internal/query/engine.go:74
↓ 4 callersMethodSetupMessages
SetupMessages adds multiple pre-built RawMessage values to the mock store in a thread-safe manner. Nil entries in the input slice are silently skipped
internal/gmail/mock.go:282
↓ 4 callersMethodShutdown
Shutdown gracefully shuts down the server.
internal/api/server.go:245
↓ 4 callersMethodSimulateTrashError
SimulateTrashError injects a trash error for a specific message ID.
internal/deletion/executor_test.go:174
↓ 4 callersFunctionStripDomain
StripDomain returns the local part of a synthetic "<slug>@facebook.messenger" email. If the input lacks the expected domain suffix, it is returned as-
internal/fbmessenger/slug.go:91
↓ 4 callersMethodTextSearch
TextSearch performs plain full-text search over text messages. Uses FTS5 if available; otherwise returns empty results.
internal/query/sqlite_text.go:420
↓ 4 callersMethodTimerCount
TimerCount returns the number of pending timers.
internal/gmail/ratelimit_test.go:70
↓ 4 callersMethodToJSON
ToJSON serializes the config to JSON.
internal/imap/config.go:88
↓ 4 callersFunctionTruncateRunes
TruncateRunes truncates a string to maxRunes runes (not bytes), adding "..." if truncated. This is UTF-8 safe and won't split multi-byte characters.
internal/textutil/encoding.go:125
↓ 4 callersMethodUpdateSourceSyncConfig
UpdateSourceSyncConfig updates the JSON sync configuration for an IMAP source. The sync_config column is JSONB on PG; the dialect supplies the appropr
internal/store/sync.go:702
↓ 4 callersFunctionValidateCronExpr
ValidateCronExpr validates a cron expression without scheduling anything.
internal/scheduler/scheduler.go:489
↓ 4 callersMethodWithGmailIDs
(ids ...string)
internal/tui/setup_test.go:131
↓ 4 callersFunctionWithLogger
WithLogger sets the logger for the client.
internal/gmail/client.go:43
↓ 4 callersMethodWithProgress
WithProgress sets the progress reporter.
internal/sync/sync.go:96
↓ 4 callersMethodWithReason
WithReason adds an entry to the errors[].reason array.
internal/gmail/client_test.go:48
↓ 4 callersMethodWithSummary
WithSummary sets the manifest summary.
internal/deletion/manifest_test.go:63
↓ 4 callersFunctionWriteAndVerifyFile
WriteAndVerifyFile writes content to a file, asserts it exists, and verifies its content matches. Returns the full path to the written file.
internal/testutil/fs_helpers.go:102
↓ 4 callersMethodadd
(obj types.Object)
tools/testifyhelpercheck/analyzer.go:202
↓ 4 callersFunctionaggRowMap
aggRowMap builds a map from key to count, failing on duplicate keys.
internal/query/sqlite_testhelpers_test.go:74
↓ 4 callersFunctionappleTimestampToTime
appleTimestampToTime converts an Apple epoch timestamp to time.Time. macOS High Sierra+ stores dates as nanoseconds since Apple epoch; older versions
internal/imessage/parser.go:20
↓ 4 callersFunctionassertDedupDeleted
( t *testing.T, st *store.Store, msgID int64, wantDeleted bool, )
internal/store/dedup_test.go:114
↓ 4 callersFunctionassertMessageNotHasLabel
assertMessageNotHasLabel checks that a message does NOT have a specific label.
internal/sync/testenv_test.go:276
↓ 4 callersFunctionassertRow
assertRow finds a single key in the aggregate rows and asserts its count is 1.
internal/query/sqlite_testhelpers_test.go:100
↓ 4 callersFunctionassertRowsContain
assertRowsContain verifies that a subset of expected key/count pairs exist in the aggregate rows (order-independent). Also checks for duplicate keys.
internal/query/sqlite_testhelpers_test.go:87
↓ 4 callersFunctionassertTempDirSecured
assertTempDirSecured checks that a temp dir has permissions no more permissive than 0700. This is umask-tolerant (stricter is fine).
internal/config/config_test.go:498
↓ 4 callersFunctionattrs
(start xml.StartElement)
internal/synctechsms/parser.go:279
↓ 4 callersMethodbatchPopulate
batchPopulate batch-loads recipients and labels for a slice of messages.
internal/store/api.go:756
↓ 4 callersFunctionbuildRecipientSet
buildRecipientSet deduplicates addresses and returns a RecipientSet ready for store.PersistMessage.
internal/importer/ingest.go:259
↓ 4 callersMethodbuildWhereClause
keyColumns are passed through to buildAggregateSearchConditions to control which columns text search terms filter on.
internal/query/duckdb.go:650
↓ 4 callersFunctionconfirmEmbed
confirmEmbed reads a y/N answer from the command input. Default is no.
cmd/msgvault/cmd/confirm.go:91
↓ 4 callersMethodconnect
connect establishes and authenticates the IMAP connection. Caller must hold mu.
internal/imap/client.go:86
↓ 4 callersMethodcontains
(sub string)
internal/vector/pgvector/review_fixes_test.go:41
↓ 4 callersMethodcountLive
(sourceID int64)
internal/deletion/executor_e2e_test.go:102
↓ 4 callersFunctioncountMessages
(t *testing.T, st *store.Store, where string)
internal/fbmessenger/importer_test.go:33
↓ 4 callersFunctioncreateEngineFromBuilder
--------------------------------------------------------------------------- Shared helpers -----------------------------------------------------------
internal/query/testfixtures_test.go:601
↓ 4 callersMethoddrain
drain sets tokens to zero.
internal/gmail/ratelimit_test.go:127
↓ 4 callersFunctionensureAddressUTF8
ensureAddressUTF8 validates and converts address names to valid UTF-8 in place.
internal/sync/sync.go:752
↓ 4 callersFunctionexecuteQuery
executeQuery opens an in-memory DuckDB, registers views over the Parquet files in analyticsDir, runs the SQL, and writes the results in the requested
cmd/msgvault/cmd/query.go:83
↓ 4 callersMethodexitInlineSearchMode
exitInlineSearchMode resets inline search UI state without changing filter state.
internal/tui/keys.go:1267
↓ 4 callersFunctionextractBaseSemver
extractBaseSemver extracts the base semver from a version string.
internal/update/update.go:711
↓ 4 callersFunctionextractValue
extractValue extracts the value part from a vCard line, handling both "KEY:value" and "KEY;params:value" formats.
internal/vcard/vcard.go:121
↓ 4 callersFunctionformatAddresses
formatAddresses formats a slice of addresses as a comma-separated string.
internal/tui/format.go:176
↓ 4 callersFunctionformatAddresses
(addrs []query.Address)
cmd/msgvault/cmd/show_message.go:250
↓ 4 callersFunctionformatCount
formatCount formats a number with thousand separators.
cmd/msgvault/cmd/list_accounts.go:174
↓ 4 callersMethodformatDuration
(d time.Duration)
cmd/msgvault/cmd/deletions.go:657
↓ 4 callersFunctionformatInspectTime
(t sql.NullTime)
internal/store/inspect.go:14
↓ 4 callersFunctiongetIDArg
getIDArg extracts a required positive integer ID from the arguments map.
internal/mcp/handlers.go:154
↓ 4 callersFunctionguessMime
(uri string)
internal/fbmessenger/json_parser.go:393
↓ 4 callersFunctionhasAttr
hasAttr checks whether attr is in the attrs list.
internal/imap/client.go:529
↓ 4 callersFunctionhistoryLabelRemoved
(id string, labels ...string)
internal/sync/testenv_test.go:318
↓ 4 callersFunctionidentObject
(pass *analysis.Pass, ident *ast.Ident)
tools/testifyhelpercheck/analyzer.go:220
↓ 4 callersFunctionidsToJSON
idsToJSON encodes an int64 slice as a JSON array for the json_each pattern used in the fused CTE. Returns a NULL NullString when the slice is empty, s
internal/vector/sqlitevec/fused.go:451
↓ 4 callersFunctionimapScopeForTenant
imapScopeForTenant returns the correct IMAP scope based on the tenant ID. The consumer tenant has a fixed, well-known ID; all others are org tenants.
internal/microsoft/oauth.go:91
↓ 4 callersFunctioninClause
inClause returns "col IN (?,?,?)" for len(ids) placeholders. Caller must append the ids to the args slice in the same order.
internal/vector/sqlitevec/backend.go:1275
↓ 4 callersFunctionindexNames
indexNames returns the names of every index on the embeddings table in the connection's own (per-test) schema. Used by the V3 and V5 tests to assert w
internal/vector/pgvector/review_fixes_test.go:168
↓ 4 callersFunctioninferTimeGranularity
inferTimeGranularity adjusts the granularity based on the time period string length.
internal/query/duckdb.go:1059
↓ 4 callersMethodinitSyncState
initSyncState initializes sync state, resuming from checkpoint if possible.
internal/sync/sync.go:116
↓ 4 callersFunctionisExchangeDN
isExchangeDN reports whether s looks like an Exchange Distinguished Name.
internal/pst/reader.go:309
↓ 4 callersFunctionisOwnerOnly
isOwnerOnly returns true if the permission mode grants nothing to group or other.
internal/fileutil/secure_windows.go:15
↓ 4 callersFunctionkeyLeft
keyLeft returns a KeyMsg for the Left arrow key.
internal/tui/setup_test.go:539
↓ 4 callersFunctionkeyRight
keyRight returns a KeyMsg for the Right arrow key.
internal/tui/setup_test.go:544
↓ 4 callersFunctionloadParticipants
(ctx context.Context, db *sql.DB, messageID int64, recipientType string)
scripts/mimeshootout/main.go:334
↓ 4 callersMethodloadTextConversations
loadTextConversations fetches text conversations matching the current filter.
internal/tui/text_commands.go:44
↓ 4 callersFunctionmakeRealStreamtypedBlob
makeRealStreamtypedBlob builds a blob matching the actual macOS Sequoia format where the multi-byte length has extra framing bytes (0x81, 0x92, 0x00)
internal/imessage/parser_test.go:227
↓ 4 callersFunctionmakeRows
makeRows creates 10 AggregateRows with sequential keys ("row-0", "row-1", ...).
internal/tui/setup_test.go:563
↓ 4 callersFunctionmapConversation
mapConversation maps a WhatsApp chat to a msgvault conversation. Returns the source_conversation_id, conversation_type, and title.
internal/whatsapp/mapping.go:23
← previousnext →801–900 of 5,225, ranked by callers