MCPcopy Create free account

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

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

↓ 6 callersFunctionSanitizeFilename
SanitizeFilename removes or replaces characters that are invalid in filenames.
internal/export/attachments.go:189
↓ 6 callersFunctionSanitizeUTF8
SanitizeUTF8 replaces invalid UTF-8 bytes with replacement character.
internal/textutil/encoding.go:73
↓ 6 callersMethodScheduledAccounts
ScheduledAccounts returns accounts with scheduling enabled.
internal/config/config.go:546
↓ 6 callersMethodSearch
Search performs a Gmail-style search query. Uses direct SQLite connection for FTS5 support when available, falls back to LIKE queries via sqlite_scan
internal/query/duckdb.go:1563
↓ 6 callersFunctionSecureOpenFile
SecureOpenFile opens the named file with specified flag and permissions.
internal/fileutil/secure_unix.go:28
↓ 6 callersFunctionSecureWriteFile
SecureWriteFile writes data to the named file, creating it if necessary.
internal/fileutil/secure_unix.go:13
↓ 6 callersFunctionStoreAttachmentFile
StoreAttachmentFile stores att.Content on disk under attachmentsDir using content-addressed storage (hash[:2]/hash). It validates existing files when
internal/export/store_attachment.go:136
↓ 6 callersMethodStripBase64Enabled
StripBase64Enabled returns the effective strip_base64 setting. Defaults to true when the field is unset — inline base64 blobs (images, embedded MIME p
internal/vector/config.go:122
↓ 6 callersMethodStripHTMLEnabled
StripHTMLEnabled returns the effective strip_html setting. Defaults to true when the field is unset — HTML markup that leaks into body_text tokenizes
internal/vector/config.go:111
↓ 6 callersMethodStripQuotesEnabled
StripQuotesEnabled returns the effective strip_quotes setting. Defaults to true when the field is unset.
internal/vector/config.go:91
↓ 6 callersMethodStripSignaturesEnabled
StripSignaturesEnabled returns the effective strip_signatures setting. Defaults to true when the field is unset.
internal/vector/config.go:100
↓ 6 callersMethodStripURLTrackingEnabled
StripURLTrackingEnabled returns the effective strip_url_tracking setting. Defaults to true when the field is unset — utm_*, fbclid, etc. add no semant
internal/vector/config.go:133
↓ 6 callersMethodTokenPath
(email string)
internal/microsoft/oauth.go:602
↓ 6 callersMethodUpdateImessageParticipantDisplayNameByPhone
UpdateImessageParticipantDisplayNameByPhone backfills display_name for an iMessage-imported participant, treating the legacy "display_name = phone_num
internal/store/messages.go:1381
↓ 6 callersMethodUpdateParticipantDisplayNameByEmail
UpdateParticipantDisplayNameByEmail updates the display_name for an existing participant identified by email address. Only updates if display_name is
internal/store/messages.go:1660
↓ 6 callersMethodUpsertMessageRawWithFormat
UpsertMessageRawWithFormat stores compressed raw data with an explicit format. Unlike UpsertMessageRaw (which hardcodes 'mime'), this accepts the form
internal/store/messages.go:1697
↓ 6 callersFunctionValidateContentHash
ValidateContentHash validates that a content hash is a valid SHA-256 hex string. This prevents path traversal attacks by ensuring the hash contains on
internal/export/attachments.go:27
↓ 6 callersFunctionaddExample
(examples map[MismatchType][]MismatchExample, mt MismatchType, msg PythonMessage, pythonVal, enmimeVal string,
scripts/mimeshootout/main.go:266
↓ 6 callersMethodassertAvailable
assertAvailable checks the current available tokens.
internal/gmail/ratelimit_test.go:142
↓ 6 callersFunctionassertThreadSourceID
assertThreadSourceID checks the source_conversation_id for a message's thread.
internal/sync/testenv_test.go:242
↓ 6 callersMethodattachmentRowsForHash
attachmentRowsForHash counts attachment rows carrying the given content hash. The hash argument is always hashShared in the current suite but kept exp
internal/store/attachment_e2e_test.go:88
↓ 6 callersFunctionbuildBenchData
buildBenchData generates a 100K-message Parquet dataset directly via DuckDB SQL (no Go-side row generation). This produces realistic cardinality: 500
internal/query/benchmark_test.go:21
↓ 6 callersFunctioncalculateScrollOffset
calculateScrollOffset computes the new scroll offset to keep cursor visible within pageSize.
internal/tui/navigation.go:77
↓ 6 callersFunctioncomputeThreadID
computeThreadID computes the conversation thread ID for a set of participant phones. For 1:1 texts, uses the other party's normalized phone. For group
internal/gvoice/parser.go:403
↓ 6 callersFunctioncreateAttachmentFixture
createAttachmentFixture creates a content-addressed file under dir using the given hash.
internal/mcp/server_test.go:793
↓ 6 callersMethoddrillFilterKey
drillFilterKey returns the key value from the drillFilter based on drillViewType.
internal/tui/model.go:737
↓ 6 callersFunctionfakeEmbedServer
fakeEmbedServer is a tiny stub /v1/embeddings server that returns one zero-vector (with the leading element set to 1) per input at the test dimension.
cmd/msgvault/cmd/search_vector_test.go:99
↓ 6 callersFunctionfindScheduledSyncSource
findScheduledSyncSource resolves the source row for a scheduler identifier. Returns (nil, nil) when no syncable source matches — callers fall back to
cmd/msgvault/cmd/serve.go:463
↓ 6 callersMethodgetAccountID
getAccountID looks up a source ID by email address. Returns nil if account is empty (no filter), or an error if not found.
internal/mcp/handlers.go:137
↓ 6 callersFunctiongetSynctechSource
(t *testing.T, st *store.Store, ownerPhone string)
cmd/msgvault/cmd/add_synctech_sms_drive_test.go:244
↓ 6 callersFunctiongetTokenSourceWithReauth
getTokenSourceWithReauth tries to get a token source for the given email. If the token exists but is expired/revoked (invalid_grant), it automatically
cmd/msgvault/cmd/root.go:428
↓ 6 callersMethodhandleMessageListKeys
handleMessageListKeys handles keys in the message list view.
internal/tui/keys.go:319
↓ 6 callersMethodhasSelection
hasSelection returns true if any items are selected.
internal/tui/model.go:1472
↓ 6 callersFunctioninsertGenerationStatic
insertGenerationStatic inserts an index_generations row with the given state. id is used verbatim (not auto-increment).
internal/vector/embed/testsupport_test.go:149
↓ 6 callersFunctionisGroupChat
isGroupChat returns true if the chat represents a group conversation. A chat is a group if group_type > 0 OR if the JID server is "g.us". Some groups
internal/whatsapp/mapping.go:17
↓ 6 callersFunctionmkV10Mailbox
mkV10Mailbox creates a modern V10-style mailbox structure with <GUID>/Data/Messages/ layout.
internal/emlx/discover_test.go:30
↓ 6 callersFunctionnewAttachmentCorpus
(t *testing.T)
internal/store/attachment_e2e_test.go:27
↓ 6 callersFunctionnewIdentifierMatch
newIdentifierMatch classifies raw via looksLikeEmail and packages the classification with the raw input. Empty input is permitted (it falls into the n
internal/store/identifier_match.go:74
↓ 6 callersFunctionnewLoggedDB
(db *sql.DB, rebind func(string) string)
internal/store/db_logger.go:81
↓ 6 callersFunctionnewVectorSearchTestEnv
newVectorSearchTestEnv stands up the CLI prerequisites for a `msgvault search --mode=vector|hybrid` invocation: - a real msgvault.db with InitSchema
cmd/msgvault/cmd/search_vector_test.go:33
↓ 6 callersFunctionopenIntegrationStore
(t *testing.T)
internal/importer/pst_integration_test.go:15
↓ 6 callersFunctionopenTestStore
openTestStore creates a temporary store for internal tests.
internal/store/api_test.go:40
↓ 6 callersMethodparticipantID
(address, displayName string)
internal/synctechsms/importer.go:269
↓ 6 callersFunctionpeekTIDFromJWT
peekTIDFromJWT does a minimal unverified decode of a JWT to extract the "tid" (tenant ID) claim. Used only to determine which OIDC provider URL to con
internal/microsoft/oauth.go:572
↓ 6 callersFunctionprintJSON
(v any)
cmd/msgvault/cmd/output.go:128
↓ 6 callersMethodqueryContext
queryContext runs QueryContext with dialect-aware placeholder rebinding.
internal/query/sqlite.go:110
↓ 6 callersFunctionrawMIMEWithInlineImage
rawMIMEWithInlineImage is a convenience wrapper for the common inline case.
internal/api/handlers_test.go:2038
↓ 6 callersFunctionreadConvTitle
(t *testing.T, st *store.Store, id int64)
internal/store/messages_test.go:325
↓ 6 callersMethodreconnect
reconnect closes the current connection and re-establishes it. Only connection-level state is cleared; per-sync caches (messageListCache, msgIDToLabel
internal/imap/client.go:150
↓ 6 callersFunctionresolveAccountList
(cmd *cobra.Command, st *store.Store, accounts string)
cmd/msgvault/cmd/collection.go:210
↓ 6 callersMethodresolveParticipant
( s *store.Store, phone, displayName string, cache map[string]int64, summary *ImportSummary, )
internal/gvoice/client.go:695
↓ 6 callersFunctionrunStartupMigrationsForIngest
runStartupMigrationsForIngest is the pre-source-create hook for ingest commands. The only startup migration today is MigrateLegacyIdentityConfig, whic
cmd/msgvault/cmd/store_resolver.go:63
↓ 6 callersFunctionsaveEmlxCheckpoint
( st *store.Store, syncID int64, rootDir string, mboxIdx int, mboxPath string, lastFile string, cp *store.C
internal/importer/emlx_import.go:593
↓ 6 callersFunctionseedMessageWithAttachment
seedMessageWithAttachment creates a source (if new), conversation, message, and attachment row for use in remove-account tests. Returns nothing; calle
cmd/msgvault/cmd/remove_account_test.go:28
↓ 6 callersMethodseedMsg
seedMsg inserts a row in messages, optionally an attachment, and updates search_fts using the same 'simple' config the fused query uses on its side.
internal/vector/pgvector/fused_test.go:53
↓ 6 callersFunctionseedPending
seedPending inserts a pending_embeddings row for (gen, msgID) directly, without going through the worker. The message row is created first to satisfy
internal/vector/pgvector/backend_retire_test.go:40
↓ 6 callersMethodsnapshot
()
internal/vector/pgvector/review_fixes_test.go:52
↓ 6 callersMethodtokenPath
tokenPath returns the path to the token file for an email. The email is sanitized to prevent path traversal attacks.
internal/oauth/oauth.go:503
↓ 6 callersFunctionviewTypeAbbrev
viewTypeAbbrev returns view type name for column headers and top-level breadcrumb.
internal/tui/view.go:88
↓ 6 callersFunctionwithAccount
()
internal/mcp/server.go:65
↓ 6 callersFunctionwithLimit
Common argument helpers for recurring tool option definitions.
internal/mcp/server.go:41
↓ 6 callersFunctionwriteMultiThreadFixture
writeMultiThreadFixture lays out `n` inbox threads under a DYI root at tmp, each with a single short message. Threads are named "thread_{i}_OK" so tha
internal/fbmessenger/importer_test.go:618
↓ 5 callersMethodAcquire
Acquire blocks until the required tokens are available. Returns an error if the context is cancelled.
internal/gmail/ratelimit.go:148
↓ 5 callersMethodAddMessage
AddMessage inserts a message with its from/to/cc recipients and returns the message ID.
internal/testutil/dbtest/dbtest.go:298
↓ 5 callersMethodAllow
Allow checks if a request from the given key should be allowed.
internal/api/middleware.go:132
↓ 5 callersMethodAssertManifestExecution
AssertManifestExecution verifies the persisted execution state of a manifest.
internal/deletion/executor_test.go:158
↓ 5 callersMethodAssertNotCompleted
AssertNotCompleted verifies that OnComplete was not called.
internal/deletion/executor_test.go:124
↓ 5 callersMethodBatchDeleteMessages
BatchDeleteMessages permanently deletes multiple messages (max 1000).
internal/gmail/api.go:41
↓ 5 callersMethodBoolTrueExpr
BoolTrueExpr returns a SQL boolean expression that is true when col holds a "true" value. SQLite stores booleans as 0/1 INTEGER so we must emit "col =
internal/query/dialect.go:81
↓ 5 callersFunctionBuildHandler
BuildHandler constructs the slog handler configured according to Options. It: - creates the logs directory on demand, - rotates the daily file if it
internal/logging/logging.go:155
↓ 5 callersFunctionDriverName
DriverName returns the default sqlite3 driver name since sqlite-vec is not compiled in.
internal/vector/sqlitevec/ext_stub.go:25
↓ 5 callersMethodEffectiveTenantID
EffectiveTenantID returns the tenant ID, defaulting to "common" (multi-tenant, works for personal + org accounts).
internal/config/config.go:229
↓ 5 callersMethodEnsureSeeded
EnsureSeeded guarantees that the building generation gen has had its initial pending_embeddings seed pass committed. If a prior CreateGeneration crash
internal/vector/backend.go:183
↓ 5 callersFunctionEscapeTSQueryTerm
EscapeTSQueryTerm tokenizes a single user-supplied search term into PostgreSQL `to_tsquery`-safe lexemes. The input is split on every rune that isn't
internal/sqldialect/sqldialect.go:58
↓ 5 callersMethodExec
(query string, args ...any)
internal/store/store.go:526
↓ 5 callersFunctionFirstLine
FirstLine returns the first line of a string, capped at 200 runes. Useful for extracting clean error messages from multi-line outputs where the first
internal/textutil/encoding.go:143
↓ 5 callersMethodGetRandomMessageIDs
GetRandomMessageIDs returns a random sample of message IDs for a source. Uses reservoir sampling with random offsets for O(limit) performance on large
internal/store/messages.go:888
↓ 5 callersMethodGetSourceByID
GetSourceByID returns the source with the given ID, or ErrSourceNotFound (wrapped) if no row matches.
internal/store/sources.go:18
↓ 5 callersMethodHasAnyActiveSync
HasAnyActiveSync returns true if any source currently has a running sync. Use this as a safety gate before performing destructive file operations that
internal/store/sync.go:528
↓ 5 callersMethodHasEmptyTargets
HasEmptyTargets returns true if any empty targets are active (set to true).
internal/query/models.go:274
↓ 5 callersMethodHasScope
HasScope checks if the stored token for the given email was authorized with the specified scope. Returns false if the token doesn't exist or doesn't h
internal/oauth/oauth.go:445
↓ 5 callersMethodIMAPHost
IMAPHost returns the correct IMAP hostname for the given email based on the persisted token's scope. Must be called after Authorize completes. Persona
internal/microsoft/oauth.go:330
↓ 5 callersMethodInspectRawDataExists
InspectRawDataExists checks that raw MIME data exists for a message.
internal/store/inspect.go:187
↓ 5 callersMethodIsBusyError
IsBusyError returns true for SQLITE_BUSY and SQLITE_LOCKED. Matching on the result code is more robust than substring matching: BUSY surfaces as "data
internal/store/dialect_sqlite.go:341
↓ 5 callersMethodIsRunning
()
internal/api/server.go:55
↓ 5 callersMethodIsSentCopy
IsSentCopy reports whether this message appears to be the sender-side copy of an outbound email. Three independent signals (OR-combined): - Gmail SENT
internal/dedup/dedup.go:199
↓ 5 callersMethodLoadVector
LoadVector returns the embedding for a specific message in the active generation. Returns ErrNoActiveGeneration if none exists, or a descriptive error
internal/vector/backend.go:189
↓ 5 callersMethodMaxPageSizeHybridClamp
MaxPageSizeHybridClamp returns the effective per-request limit clamp: zero means "no clamp", a positive value means "clamp to N". Helper exists becaus
internal/vector/config.go:200
↓ 5 callersFunctionMustBeLocal
MustBeLocal returns an error if remote mode is active. Use this for commands that only work with local database.
cmd/msgvault/cmd/store_resolver.go:168
↓ 5 callersMethodMustSearch
MustSearch calls Search and fails the test on error.
internal/query/sqlite_testhelpers_test.go:43
↓ 5 callersFunctionNewManagerWithScopes
NewManagerWithScopes creates an OAuth manager with custom scopes.
internal/oauth/oauth.go:614
↓ 5 callersFunctionNewMockAPI
NewMockAPI creates a new mock API with empty state.
internal/gmail/mock.go:56
↓ 5 callersMethodNextFromOffset
NextFromOffset reports the stream offset of the next message's "From " line. Valid only after a successful Next() call (or Offset() at end-of-file).
internal/mbox/reader.go:101
↓ 5 callersFunctionNormalizeIdentifierForCompare
NormalizeIdentifierForCompare returns the comparison-canonical form of an identifier under the same rules as EqualIdentifier and the SQL-side LOWER()
internal/store/identifier_match.go:39
↓ 5 callersMethodOnProgress
(processed, succeeded, failed int)
internal/deletion/executor.go:37
↓ 5 callersFunctionParse
(r io.Reader)
internal/synctechsms/parser.go:15
↓ 5 callersMethodRebuildFTS
RebuildFTS fully recreates the FTS index from the underlying message tables. Unlike BackfillFTS (DELETE + INSERT), this drops and recreates the FTS ta
internal/store/messages.go:1027
↓ 5 callersMethodRemoveAccountIdentity
RemoveAccountIdentity deletes (source_id, address) rows that match under the helper's case-aware rule. Returns the number of rows deleted (typically 0
internal/store/account_identities.go:205
↓ 5 callersMethodRemoveMessageLabels
RemoveMessageLabels removes specific labels from a message.
internal/store/messages.go:758
↓ 5 callersMethodRemoveSourcesFromCollection
RemoveSourcesFromCollection detaches sources. Idempotent. Rejects mutations of the auto-managed default collection.
internal/store/collection.go:263
← previousnext →601–700 of 5,225, ranked by callers