Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/kenn-io/msgvault
/ functions
Functions
5,225 in github.com/kenn-io/msgvault
⨍
Functions
5,225
◇
Types & classes
632
↓ 10 callers
Function
sendMsg
sendMsg sends any tea.Msg through Update and returns the concrete Model.
internal/tui/setup_test.go:345
↓ 10 callers
Function
setupTestManager
(t *testing.T, scopes []string)
internal/oauth/oauth_test.go:22
↓ 10 callers
Function
sourceOAuthApp
sourceOAuthApp extracts the oauth app name from a Source, returning "" for the default app.
cmd/msgvault/cmd/root.go:517
↓ 10 callers
Function
truncate
Helper functions.
cmd/msgvault/cmd/deletions.go:728
↓ 9 callers
Method
AttachmentPathsUniqueToSource
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 callers
Method
BuildPtr
()
internal/testutil/builders.go:214
↓ 9 callers
Method
EnsureLabels
EnsureLabels creates labels and returns a map of sourceLabelID → internal ID.
internal/testutil/storetest/storetest.go:66
↓ 9 callers
Method
EnsureParticipantsBatch
EnsureParticipantsBatch gets or creates participants in batch. Returns a map of email -> participant ID.
internal/store/messages.go:385
↓ 9 callers
Function
ExtractMboxFromZip
(zipPath, destDir string, log *slog.Logger)
internal/importer/mboxzip/mbox_zip.go:162
↓ 9 callers
Function
Fuse
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 callers
Method
HasAnyConfig
HasAnyConfig returns true if any OAuth configuration exists (default or named apps).
internal/config/config.go:209
↓ 9 callers
Method
IsAttachmentPathReferenced
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 callers
Method
IsMigrationApplied
IsMigrationApplied reports whether the named one-time data migration has already run.
internal/store/migrations.go:9
↓ 9 callers
Function
IsRemoteMode
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 callers
Function
Migrate
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 callers
Method
MustLookupParticipant
MustLookupParticipant returns the ID of the participant with the given email, failing the test if not found.
internal/testutil/dbtest/dbtest.go:135
↓ 9 callers
Function
NewMessageDetail
NewMessageDetail creates a builder with sensible defaults.
internal/testutil/builders.go:114
↓ 9 callers
Function
NewRateLimiter
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 callers
Function
NewServiceAccountManager
NewServiceAccountManager creates a manager from a service account JSON key file.
internal/oauth/serviceaccount.go:23
↓ 9 callers
Function
ParseFile
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 callers
Method
PendingDir
PendingDir returns the path to the pending directory.
internal/deletion/manifest.go:247
↓ 9 callers
Method
TokenSource
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 callers
Method
UpdateSourceSyncCursor
UpdateSourceSyncCursor updates the sync cursor (historyId) for a source.
internal/store/sync.go:623
↓ 9 callers
Method
WithAttachment
WithAttachment adds an attachment to the message.
internal/testutil/email/builder.go:107
↓ 9 callers
Method
WithContextStats
(stats *query.TotalStats)
internal/tui/setup_test.go:225
↓ 9 callers
Method
WithFromEmail
(e string)
internal/testutil/builders.go:32
↓ 9 callers
Method
WithLogger
WithLogger sets the logger.
internal/sync/sync.go:90
↓ 9 callers
Function
assertAggregateCounts
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 callers
Function
assertSelected
assertSelected checks that the given key is selected.
internal/tui/setup_test.go:588
↓ 9 callers
Function
cacheNeedsBuild
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 callers
Function
escapeLike
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 callers
Function
formatSize
(bytes int64)
cmd/msgvault/cmd/output.go:109
↓ 9 callers
Method
hasCol
hasCol returns true if the named column exists in the Parquet schema for the given table.
internal/query/duckdb.go:252
↓ 9 callers
Function
inlineURL
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 callers
Function
insertPGGeneration
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 callers
Function
limitArg
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 callers
Method
loadToken
loadToken loads a saved token for the given email.
internal/oauth/oauth.go:386
↓ 9 callers
Function
mkMailbox
mkMailbox creates a mock legacy Apple Mail mailbox structure with a direct Messages/ subdirectory.
internal/emlx/discover_test.go:17
↓ 9 callers
Function
normalizePhone
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 callers
Function
openLoggedMem
openLoggedMem opens an in-memory sqlite DB wrapped by loggedDB.
internal/store/db_logger_test.go:35
↓ 9 callers
Function
openPGTestDB
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 callers
Function
pgPendingCount
(t *testing.T, db *sql.DB, gen int64)
internal/vector/embed/enqueue_pg_test.go:79
↓ 9 callers
Function
requireAggregateRow
requireAggregateRow finds an AggregateRow by key or fails the test.
internal/query/duckdb_test.go:54
↓ 9 callers
Method
resolveTokenEmail
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 callers
Method
saveCheckpoint
saveCheckpoint persists the current execution progress to disk.
internal/deletion/executor.go:135
↓ 9 callers
Function
setupVectorFeatures
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 callers
Function
standardStats
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 callers
Function
viewTypePrefix
viewTypePrefix returns a short prefix for drill-down breadcrumbs (e.g., "S:" for Sender).
internal/tui/view.go:110
↓ 9 callers
Function
writeEmbeddings
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 callers
Method
Advance
Advance moves the clock forward and fires any pending timers.
internal/gmail/ratelimit_test.go:91
↓ 8 callers
Method
ApplyDefaults
ApplyDefaults fills in sensible defaults for any zero-valued fields. Called after TOML decode, before Validate.
internal/vector/config.go:290
↓ 8 callers
Method
AssertRecipientCount
AssertRecipientCount asserts the number of recipients of a given type for a message.
internal/testutil/storetest/storetest.go:183
↓ 8 callers
Method
Authorize
(ctx context.Context, email string)
cmd/msgvault/cmd/root.go:417
↓ 8 callers
Method
Build
Build returns the constructed Manifest.
internal/deletion/manifest_test.go:98
↓ 8 callers
Function
BuildManifest
BuildManifest starts building a Manifest with sensible defaults. If no IDs are provided, defaults to {"id1", "id2"}.
internal/deletion/manifest_test.go:48
↓ 8 callers
Method
CancelManifest
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 callers
Method
CreateManifest
CreateManifest creates a manifest with the given name and Gmail IDs.
internal/deletion/executor_test.go:88
↓ 8 callers
Method
DeleteMessage
DeleteMessage permanently deletes a message.
internal/gmail/api.go:38
↓ 8 callers
Method
GetBodyText
GetBodyText returns the best available body text. Prefers plain text, falls back to stripped HTML.
internal/mime/parse.go:353
↓ 8 callers
Method
GetSourcesByIdentifier
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 callers
Method
GetStatsForScope
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 callers
Method
HasToken
(email string)
cmd/msgvault/cmd/root.go:416
↓ 8 callers
Method
InspectMessage
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 callers
Method
IsEmpty
IsEmpty reports whether the scope resolved to nothing.
cmd/msgvault/cmd/account_scope.go:19
↓ 8 callers
Method
ListAccounts
Account queries
internal/query/engine.go:77
↓ 8 callers
Function
LoadManifest
LoadManifest reads a manifest from a JSON file.
internal/deletion/manifest.go:131
↓ 8 callers
Method
MarkDeletedByID
MarkDeletedByID marks a message as deleted by its internal ID.
internal/testutil/dbtest/dbtest.go:404
↓ 8 callers
Method
MessageExistsBatch
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 callers
Function
MkTempDir
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 callers
Function
New
New creates a new TUI model with the given options.
internal/tui/model.go:226
↓ 8 callers
Function
Parse
Parse parses raw MIME data into a Message.
internal/mime/parse.go:54
↓ 8 callers
Function
ParseE2EEJSONFile
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 callers
Method
Rate
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 callers
Method
SearchFastWithStats
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 callers
Function
SecureChmod
SecureChmod changes the mode of the named file.
internal/fileutil/secure_unix.go:23
↓ 8 callers
Method
SetOptions
SetOptions replaces the Syncer with one configured by the given modifier function.
internal/sync/testenv_test.go:75
↓ 8 callers
Function
Slug
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 callers
Method
StageForDeletion
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 callers
Method
WalkFolders
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 callers
Method
WithAccounts
(accounts ...query.AccountInfo)
internal/tui/setup_test.go:136
↓ 8 callers
Function
assertNotSelected
assertNotSelected checks that the given key is not selected.
internal/tui/setup_test.go:594
↓ 8 callers
Function
assertViewFitsHeight
assertViewFitsHeight checks that the rendered view fits within the given height.
internal/tui/setup_test.go:681
↓ 8 callers
Function
createFakeParquet
createFakeParquet creates fake parquet files for all required directories to simulate a complete existing cache.
cmd/msgvault/cmd/build_cache_test.go:1261
↓ 8 callers
Function
getAttr
getAttr returns the value of the named attribute, or empty string.
internal/gvoice/parser.go:442
↓ 8 callers
Function
historyLabelAdded
(id string, labels ...string)
internal/sync/testenv_test.go:307
↓ 8 callers
Function
int64Array
int64Array formats an int64 slice as the PostgreSQL array literal "{1,2,3}". Bound via $N::bigint[].
internal/vector/pgvector/backend.go:776
↓ 8 callers
Function
isPgError
isPgError checks if err is a pgconn.PgError with the given SQLSTATE code.
internal/store/dialect_pg.go:506
↓ 8 callers
Function
joinRows
joinRows maps each item to a SQL row string and joins them with commas.
internal/query/testfixtures_test.go:307
↓ 8 callers
Method
loadMessages
loadMessages fetches messages based on current filter (first page).
internal/tui/model.go:679
↓ 8 callers
Function
logStmtWith
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 callers
Function
newRateWindow
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 callers
Function
normalizeMCPHTTPAddr
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 callers
Function
pendingCount
pendingCount returns the number of pending_embeddings rows for a generation.
internal/vector/sqlitevec/backend_test.go:60
↓ 8 callers
Function
pgCountAvailable
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 callers
Method
processBatch
processBatch processes a single batch of messages from a list response.
internal/sync/sync.go:162
↓ 8 callers
Method
request
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 callers
Function
seedMessage
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 callers
Method
state
state returns a snapshot of the limiter's refill rate and throttle deadline under the mutex.
internal/gmail/ratelimit_test.go:135
↓ 8 callers
Function
supportPST
(t *testing.T)
internal/pst/reader_test.go:16
↓ 8 callers
Function
timeToAppleTimestamp
timeToAppleTimestamp converts a time.Time to an Apple epoch timestamp. If useNano is true, returns nanoseconds; otherwise returns seconds.
internal/imessage/parser.go:36
← previous
next →
401–500 of 5,225, ranked by callers