Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PerpetualSoftware/pad
/ functions
Functions
6,005 in github.com/PerpetualSoftware/pad
⨍
Functions
6,005
◇
Types & classes
763
↓ 13 callers
Method
GetCrossWorkspaceBacklinks
GetCrossWorkspaceBacklinks returns inbound `[[ws::REF]]` backlinks pointing at the queried target (`targetWorkspaceID`, `targetRef`) from EVERY OTHER
internal/store/wiki_links.go:1191
↓ 13 callers
Method
GetMemberCollectionAccess
GetMemberCollectionAccess returns the collection IDs a member has been explicitly granted access to (only meaningful when collection_access = "specifi
internal/store/workspace_members.go:310
↓ 13 callers
Method
InsertMCPAuditEntry
InsertMCPAuditEntry persists one audit row. Called from the audit middleware's async writer; the caller owns the buffered channel + the ordering, so t
internal/store/mcp_audit.go:53
↓ 13 callers
Method
IsConfigured
IsConfigured reports whether the client has an explicit global connection configuration, either from config.toml or an environment/flag override.
internal/config/config.go:277
↓ 13 callers
Method
ListDocumentActivity
(documentID string, params models.ActivityListParams)
internal/store/activities.go:407
↓ 13 callers
Method
ListWorkspaces
(ctx context.Context)
internal/mcp/errors.go:297
↓ 13 callers
Function
Load
()
internal/config/config.go:105
↓ 13 callers
Function
NewDispatcher
NewDispatcher creates a Dispatcher with the given store. The delivery client enforces the SSRF guard at connect time, not just at parse time: its dia
internal/webhooks/dispatcher.go:115
↓ 13 callers
Function
NormalizeItemLinkType
NormalizeItemLinkType canonicalizes supported link types and returns an error for unknown values.
internal/models/item_links.go:33
↓ 13 callers
Method
ValidateSession
ValidateSession hashes the provided token, looks it up, checks expiry, and returns the session info including the associated user and binding metadata
internal/store/sessions.go:62
↓ 13 callers
Method
VisibleCollectionIDs
VisibleCollectionIDs returns the set of collection IDs a member can see. Returns nil if the member has "all" access (meaning no filtering needed). Sys
internal/store/workspace_members.go:139
↓ 13 callers
Function
bootstrapAccountDeleteUser
bootstrapAccountDeleteUser creates the first admin user, sets a Stripe customer ID on them, and returns (userID, sessionToken). Used by the handleDele
internal/server/handlers_account_test.go:70
↓ 13 callers
Method
buildAuthedRequest
( ctx context.Context, method, urlPath string, body []byte, user *models.User, )
internal/mcp/dispatch_http.go:543
↓ 13 callers
Function
deleteAccountReq
deleteAccountReq issues the delete-account request from a client IP that differs from the loopback address bootstrap ran on. The session-IP-change mid
internal/server/handlers_account_test.go:93
↓ 13 callers
Method
executeRequest
executeRequest builds + serves + packages a single HTTP request against the wrapped handler. Pulled out of Dispatch so the special-case methods (dispa
internal/mcp/dispatch_http.go:445
↓ 13 callers
Method
goAsync
goAsync spawns fn in a goroutine that's tracked by s.bg, so Stop() can wait for in-flight background work to finish. Use this for any fire-and-forget
internal/server/server.go:256
↓ 13 callers
Function
mustSeedWorkspaceWithRole
mustSeedWorkspaceWithRole is a test helper that creates a workspace + adds the user as a member with the given role. Centralized here because TASK-952
internal/server/handlers_oauth_test.go:1821
↓ 13 callers
Function
newTestClient
Tests for the OAuth 2.1 storage layer (PLAN-943 TASK-951 sub-PR A). The store layer is fosite-agnostic by design — sub-PR B introduces the fosite impo
internal/store/oauth_test.go:22
↓ 13 callers
Function
passThrough
passThrough returns an ActionFn that forwards the input verbatim to the given cmdPath via env.Dispatch. The vast majority of catalog actions use this
internal/mcp/catalog.go:178
↓ 13 callers
Function
taskSchema
()
internal/items/validate_test.go:9
↓ 13 callers
Function
uploadIntegrationPNG
(t *testing.T, srv *Server, slug string, w, h int)
internal/server/handlers_attachments_transform_test.go:41
↓ 12 callers
Method
AddConnectionWorkspace
AddConnectionWorkspace inserts a (request_id, workspace_id) row in the allow-list join table. Idempotent: re-adding an existing pair is a no-op (INSER
internal/store/oauth_connections.go:303
↓ 12 callers
Function
ExtractWikiLinks
ExtractWikiLinks scans `content` for [[...]] occurrences OUTSIDE any fenced or inline code region, parses each into a WikiLinkRef, and returns them in
internal/links/extract.go:477
↓ 12 callers
Method
GetOAuthConnectionAccess
GetOAuthConnectionAccess is the hot-path projection used by the MCP introspection middleware. Runs at most two cheap indexed queries (one PK lookup, o
internal/store/oauth_connections.go:151
↓ 12 callers
Method
Put
Put writes the blob from r into the backend, addressable by hash. The implementation MUST verify that the bytes streamed from r hash to the supplied h
internal/attachments/store.go:40
↓ 12 callers
Method
Search
(params SearchParams)
internal/store/search.go:89
↓ 12 callers
Method
SetUserPlan
SetUserPlan updates a user's billing plan.
internal/store/limits.go:288
↓ 12 callers
Function
SetWorkspaceTool
SetWorkspaceTool returns the (Tool, Handler) pair for the built-in pad_set_workspace tool. The handler updates state in place. Exposed as a construct
internal/mcp/workspace.go:121
↓ 12 callers
Method
Subscribe
Subscribe registers a new subscriber for the given workspace. Returns a buffered channel that will receive events for that workspace.
internal/events/bus.go:100
↓ 12 callers
Function
ValidateUpload
ValidateUpload combines the sniff result, the client-supplied MIME header, and the filename's extension to produce one of: - (entry, "", nil) — accep
internal/attachments/mime.go:200
↓ 12 callers
Function
WithCurrentUser
Exported context-key helpers for callers that need to synthesize an authenticated request without going through the auth middleware chain (e.g. the in
internal/server/context.go:25
↓ 12 callers
Function
actorNameFromRequest
actorNameFromRequest returns the authenticated user's display name, or empty string.
internal/server/handlers_documents.go:240
↓ 12 callers
Function
bootstrapBody
(email string)
internal/server/handlers_auth_bootstrap_token_test.go:45
↓ 12 callers
Function
childLinkTypeSQL
childLinkTypeSQL returns a SQL IN clause fragment like "'parent','implements'" for filtering item_links by child relationship types.
internal/store/items.go:23
↓ 12 callers
Function
collectionSchemaJSONFromFlags
collectionSchemaJSONFromFlags resolves the --schema and --fields flags into a marshaled CollectionSchema JSON string. Exactly one of schemaInput or f
cmd/pad/cmd_collection.go:75
↓ 12 callers
Function
doAuthedJSON
Mutation-endpoint tests for /api/v1/connected-apps/{id}/... routes (PLAN-1519 / TASK-1524 / IDEA-1517 §3). What's covered (per endpoint): - PATCH /n
internal/server/handlers_connected_apps_mutations_test.go:35
↓ 12 callers
Function
getOnlyAttachmentID
getOnlyAttachmentID returns the ID of the single live attachment row in a workspace — the test infrastructure uploads at most one blob per call, so th
internal/server/handlers_storage_test.go:410
↓ 12 callers
Function
mcpEnabledTestServer
mcpEnabledTestServer builds a Server with cloud mode + a stub streamable-HTTP transport so tests targeting auth / discovery / routing don't need to dr
internal/server/handlers_mcp_test.go:380
↓ 12 callers
Function
newMockStore
(hooks []models.Webhook)
internal/webhooks/dispatcher_test.go:25
↓ 12 callers
Function
newRequestCapture
()
internal/mcp/dispatch_http_advanced_test.go:908
↓ 12 callers
Function
newTestConfig
newTestConfig points DataDir at a fresh tmp dir and BrowserURL at the given test server. Most tests want both wired up together.
internal/cli/bootstrap_test.go:39
↓ 12 callers
Function
newVerifiedEmailFixture
(t *testing.T, cloud bool)
internal/server/middleware_verified_email_test.go:46
↓ 12 callers
Function
runHelp
runHelp invokes the help command with the given args and returns (stdout, stderr, error).
cmd/pad/help_cmdhelp_test.go:46
↓ 11 callers
Method
CreateActivity
(a models.Activity)
internal/store/activities.go:17
↓ 11 callers
Method
CreateActivityDebounced
CreateActivityDebounced creates a new activity or updates an existing one if a matching activity (same document, same user, same action) was recorded
internal/store/activities.go:39
↓ 11 callers
Function
DeriveClaimCode
DeriveClaimCode produces the 6-digit code for the given (user, workspace) at the given wall-clock time. Exported so the Phase E "Connect project" moda
internal/server/claim_codes.go:78
↓ 11 callers
Function
EnsureServer
EnsureServer checks if the pad server is running; if not, starts it in the background.
internal/cli/server.go:16
↓ 11 callers
Method
GetItemLinks
GetItemLinks returns links where the given item is either source or target. Links pointing to or from soft-deleted items are filtered out so callers (
internal/store/items.go:2695
↓ 11 callers
Method
GetOAuthClient
GetOAuthClient looks up a registered client by ID. Returns ErrOAuthNotFound if no row matches.
internal/store/oauth.go:136
↓ 11 callers
Method
GetUserWorkspaces
(userID string)
internal/mcp/dispatch_http_lister.go:51
↓ 11 callers
Function
NewFetcher
NewFetcher returns a Fetcher with production defaults applied.
internal/urlimport/fetch.go:92
↓ 11 callers
Method
Publish
Publish broadcasts an event to every subscriber whose itemID matches event.ItemID. Non-blocking: full subscriber channels drop the event with a warnin
internal/collab/bus.go:108
↓ 11 callers
Method
Save
Save writes the persisted Pad config to disk.
internal/config/config.go:253
↓ 11 callers
Method
SetEncryptionKey
SetEncryptionKey configures the store's AES-256 encryption key for encrypting sensitive fields (e.g., TOTP secrets) at rest. The key must be exactly 3
internal/store/encryption.go:19
↓ 11 callers
Method
SetTOTPSecret
--- TOTP 2FA --- SetTOTPSecret stores the TOTP secret for a user (before 2FA is verified). The secret is encrypted at rest if an encryption key is con
internal/store/users.go:1183
↓ 11 callers
Method
StarItem
StarItem stars an item for a user. Idempotent — re-starring is a no-op.
internal/store/item_stars.go:13
↓ 11 callers
Method
Unsubscribe
Unsubscribe removes a subscriber and closes its channel.
internal/events/bus.go:109
↓ 11 callers
Function
callToolRequest
── test helpers ── callToolRequest builds an mcp.CallToolRequest with the given input arguments — the public constructor isn't exposed by mcp-go so we
internal/mcp/catalog_test.go:320
↓ 11 callers
Function
containsToolText
containsToolText looks for substr in any TextContent block of res. MCP results can carry multiple content blocks; checking all of them keeps the asser
internal/mcp/dispatch_http_test.go:977
↓ 11 callers
Function
createBlocksLink
helper: create a "blocks" link from source to target
internal/server/handlers_dashboard_test.go:37
↓ 11 callers
Function
diffFields
(oldFields, newFields string)
internal/server/handlers_documents.go:414
↓ 11 callers
Function
equalStrings
(a, b []string)
internal/mcp/catalog_test.go:338
↓ 11 callers
Function
hydrateItemComputedMetadata
(item *models.Item)
internal/store/items.go:4578
↓ 11 callers
Function
makeFanOutHandler
makeFanOutHandler returns the ToolHandlerFunc that mcp-go invokes when the tool is called. Reads `action` from the input, looks up the handler, and fo
internal/mcp/catalog.go:349
↓ 11 callers
Function
makeTestImage
makeTestImage returns a freshly-allocated NRGBA image filled with a distinguishable pattern so transformation tests can assert on specific pixels. Wid
internal/attachments/processor_test.go:23
↓ 11 callers
Function
requireRole
requireRole checks if the user's workspace role meets the minimum required level. Role hierarchy: owner > editor > viewer.
internal/server/middleware_auth.go:738
↓ 11 callers
Function
testServerWithCollab
testServerWithCollab wires a RoomManager onto a fresh test server so the collab handler answers 200/101 on the happy path. Tests that only assert on a
internal/server/handlers_collab_test.go:20
↓ 10 callers
Function
AddPadEntry
AddPadEntry reads (or creates) the JSON config at path, ensures mcpServers.pad points to `binary`, and writes the file back. Existing entries outside
internal/mcp/install.go:211
↓ 10 callers
Method
CreateDocument
(workspaceID string, input models.DocumentCreate)
internal/store/documents.go:146
↓ 10 callers
Function
Decode
Decode parses an artifact's portable on-disk form back into an Artifact. It splits a leading "---\n ... \n---" frontmatter block from the body, unmar
internal/artifact/decode.go:21
↓ 10 callers
Method
Delete
Delete removes the blob identified by key. Deleting a missing key is NOT an error — callers (e.g. the orphan GC) treat it as the success case.
internal/attachments/store.go:54
↓ 10 callers
Method
DeleteWorkspace
(slug string)
internal/store/workspaces.go:255
↓ 10 callers
Function
DetectWorkspace
DetectWorkspace walks up the directory tree from cwd looking for .pad.toml.
internal/cli/workspace.go:25
↓ 10 callers
Method
Dispatch
Dispatch sends the event payload to all matching active webhooks for the workspace. Each delivery runs in its own goroutine so the caller is never blo
internal/webhooks/dispatcher.go:180
↓ 10 callers
Method
GetItemIncludeDeleted
GetItemIncludeDeleted finds an item by id including soft-deleted items. Used by code paths that need to act on records the user already owns even thou
internal/store/items.go:655
↓ 10 callers
Method
Handle
(_ context.Context, r slog.Record)
internal/store/items_test.go:1671
↓ 10 callers
Method
ListUserOAuthConnections
ListUserOAuthConnections returns every OAuth connection the user has active. "Active" means at least one access OR refresh token in the chain still ha
internal/store/connected_apps.go:59
↓ 10 callers
Method
RestoreItem
RestoreItem un-archives a soft-deleted item and bumps the workspace-scoped seq so delta-sync clients re-materialize the row. Same lock + subquery shap
internal/store/items.go:2372
↓ 10 callers
Function
RunBrowserBootstrap
RunBrowserBootstrap walks the operator through the browser-based first- admin bootstrap. Returns nil on success (server has flipped to setup_required:
internal/cli/bootstrap.go:92
↓ 10 callers
Method
SetPlatformSetting
SetPlatformSetting upserts a platform setting.
internal/store/platform_settings.go:16
↓ 10 callers
Method
append
append adds an event to the ring buffer, evicting the oldest if full.
internal/events/bus.go:147
↓ 10 callers
Function
appendToCatalog
appendToCatalog inserts def into Catalog. Called from catalog_<resource>.go init() functions. Keep this small + simple; validation happens at Register
internal/mcp/catalog.go:194
↓ 10 callers
Function
configureBootstrapToken
configureBootstrapToken seeds a known token on the server so tests don't depend on the random generator. The on-disk file is created in a temp dir so
internal/server/handlers_auth_bootstrap_token_test.go:34
↓ 10 callers
Function
connectSSE
connectSSE connects to the SSE endpoint on a real test server and returns a channel of parsed events. Cancel the context to disconnect.
internal/server/handlers_events_test.go:35
↓ 10 callers
Function
createBulkTestItem
createBulkTestItem creates a task and returns it.
internal/server/handlers_items_bulk_test.go:15
↓ 10 callers
Function
createTestWorkspace
createTestWorkspace creates a workspace via API and returns its slug.
internal/server/handlers_events_test.go:113
↓ 10 callers
Function
dialCollab
dialCollab opens a WebSocket against the test server's collab endpoint with the given itemID. Returns the connection and the HTTP response. The respon
internal/server/handlers_collab_test.go:39
↓ 10 callers
Function
doArtifactRequest
doArtifactRequest posts a raw (non-JSON) body to an artifact-import endpoint.
internal/server/handlers_artifact_test.go:17
↓ 10 callers
Function
filterAttention
filterAttention returns attention items of a given type.
internal/server/handlers_dashboard_test.go:1275
↓ 10 callers
Function
getGraph
helper: fetch the workspace graph and return the parsed response
internal/server/handlers_graph_test.go:12
↓ 10 callers
Function
mapItemCreate
mapItemCreate translates an `item create` MCP call into a POST to api/v1/workspaces/{ws}/collections/{coll}/items. The MCP tool schema (auto-generate
internal/mcp/dispatch_http.go:716
↓ 10 callers
Function
mustParseQueryFromPath
mustParseQueryFromPath extracts the query-string portion of path and parses it. Test-only — fails the test on malformed input.
internal/mcp/dispatch_http_routes_test.go:27
↓ 10 callers
Function
newBackfillTestStore
BackfillOAuthConnections tests (PLAN-1519 / TASK-1522 / IDEA-1517 §2). What's covered: - Pre-TASK-952 session (no key) → all_current=1, no
internal/store/oauth_connections_backfill_test.go:29
↓ 10 callers
Function
newOAuthConnTestStore
OAuth connection store tests (PLAN-1519 / TASK-1520 — Phase A foundation). What's covered: - CreateOAuthConnection + GetOAuthConnection round-trip w
internal/store/oauth_connections_test.go:35
↓ 10 callers
Function
newPadServer
newPadServer stands up the same *server.Server that production uses, wired to a fast fixture SQLite store (storetest.NewSQLite, IDEA-1914). Mirrors te
internal/mcp/dispatch_http_test.go:948
↓ 10 callers
Function
newTestFSStore
(t *testing.T)
internal/attachments/fs_store_test.go:22
↓ 10 callers
Function
newTestRequest
newTestRequest builds an OAuthRequest with sensible defaults; tests override fields they care about. signature uniqueness is the caller's responsibili
internal/store/oauth_test.go:42
↓ 10 callers
Function
renderMD
renderMD is a small test helper that builds + renders the synthetic tree with a fixed clock and returns the markdown output as a string.
internal/cmdhelp/md_test.go:18
↓ 10 callers
Method
runOrphanGCSweep
runOrphanGCSweep walks the orphaned-attachments query and reclaims rows past the grace period. Two reclamation paths: - DB row only. content_hash is
internal/server/orphan_gc.go:47
↓ 10 callers
Function
sha256Hex
(b []byte)
internal/attachments/fs_store_test.go:17
← previous
next →
201–300 of 6,005, ranked by callers