MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions7,856 in github.com/PerpetualSoftware/pad

↓ 861 callersMethodString
()
internal/server/token_reaper_test.go:27
↓ 541 callersFunctiontestServer
(t *testing.T)
internal/server/server_test.go:19
↓ 457 callersFunctionmake
(id: string)
web/e2e/attachment-viewer-modal.spec.ts:225
↓ 443 callersFunctiontestStore
testStore creates a Store for testing. When PAD_TEST_POSTGRES_URL is set, it creates an isolated PostgreSQL database; otherwise it falls back to a fas
internal/store/store_test.go:21
↓ 440 callersMethodq
q rebinds a query to the store's dialect (converts "?" to "$1", "$2", etc. for PostgreSQL).
internal/store/store.go:838
↓ 380 callersMethodClose
Close shuts down the bus and closes every active subscriber channel. After Close, Subscribe / Publish are undefined; callers must not invoke them.
internal/collab/bus.go:118
↓ 313 callersMethodScan
(dest ...interface{})
internal/store/api_tokens.go:303
↓ 313 callersFunctiondoRequest
(srv *Server, method, path string, body interface{})
internal/server/server_test.go:40
↓ 281 callersFunctioncreateTestWorkspace
(t *testing.T, s *Store, name string)
internal/store/store_test.go:248
↓ 275 callersMethodJoin
Join attaches a freshly-upgraded WebSocket connection to the room for itemID. Replays the op-log to the new peer, spins up an inbound reader and an ou
internal/collab/manager.go:323
↓ 269 callersFunctionparseJSON
(t *testing.T, rr *httptest.ResponseRecorder, v interface{})
internal/server/server_test.go:64
↓ 267 callersMethodNow
Now returns the SQL expression for the current UTC timestamp. SQLite: datetime('now') PostgreSQL: NOW() AT TIME ZONE 'UTC'
internal/store/dialect.go:54
↓ 260 callersMethodExec
(query string, args ...any)
internal/store/store.go:469
↓ 249 callersMethodSet
Set replaces the session workspace. Pass an empty string to clear.
internal/mcp/workspace.go:79
↓ 237 callersMethodRun
Run starts the stdio transport on os.Stdin / os.Stdout. It blocks until ctx is cancelled, stdin reaches EOF, or SIGINT / SIGTERM is received. EOF and
internal/mcp/server.go:87
↓ 215 callersFunctionwriteError
(w http.ResponseWriter, status int, code, message string)
internal/server/server.go:1901
↓ 211 callersMethodQueryRow
(query string, args ...any)
internal/store/items.go:3324
↓ 211 callersFunctioncreateTestCollection
--- Collection helpers ---
internal/store/items_test.go:14
↓ 202 callersMethodGet
Get returns a ReadCloser positioned at the start of the blob. Callers MUST close the returned reader. If key is unknown to this store, the returned er
internal/attachments/store.go:45
↓ 200 callersFunctioncreateTestItem
(t *testing.T, s *Store, workspaceID, collectionID, title, content string)
internal/store/items_test.go:26
↓ 197 callersMethodQuery
(query string, args ...any)
internal/store/items.go:4182
↓ 195 callersFunctioncreateWSWithCollections
createWSWithCollections creates a workspace and returns its slug. The workspace will have default collections seeded automatically.
internal/server/handlers_items_test.go:40
↓ 191 callersFunctionwriteInternalError
writeInternalError logs the real error server-side and sends a generic message to the client. This prevents leaking SQL errors, file paths, and other
internal/server/server.go:1913
↓ 191 callersFunctionwriteJSON
(w http.ResponseWriter, status int, v interface{})
internal/server/server.go:1894
↓ 185 callersMethodError
()
internal/server/handlers_collab.go:568
↓ 183 callersMethodServeHTTP
(w http.ResponseWriter, r *http.Request)
internal/server/server.go:1829
↓ 175 callersMethodCreateUser
CreateUser creates a new user with a hashed password.
internal/store/users.go:85
↓ 170 callersMethodAddWorkspaceMember
AddWorkspaceMember adds a user to a workspace with the given role.
internal/store/workspace_members.go:22
↓ 150 callersMethodCreateWorkspace
(input models.WorkspaceCreate)
internal/store/workspaces.go:68
↓ 141 callersMethodCreateItem
(workspaceID, collectionID string, input models.ItemCreate)
internal/store/items.go:176
↓ 139 callersFunctionbootstrapFirstUser
(t *testing.T, srv *Server, email, name string)
internal/server/handlers_auth_test.go:15
↓ 124 callersFunctiondoRequestWithCookie
doRequestWithCookie is like doRequest but adds a session cookie.
internal/server/handlers_auth_test.go:478
↓ 116 callersFunctionfixedUserResolver
fixedUserResolver is a tiny helper for the unit tests that need a deterministic user without standing up the auth middleware.
internal/mcp/dispatch_http_test.go:23
↓ 114 callersFunctiontestServerWithAttachments
testServerWithAttachments returns a fresh test server with the attachment registry wired against an FSStore rooted in t.TempDir(), and (on the pure-Go
internal/server/handlers_attachments_test.go:34
↓ 110 callersMethodError
()
internal/store/items.go:1975
↓ 110 callersMethodgetWorkspaceID
getWorkspaceID resolves workspace slug/ID from the request. If RequireWorkspaceAccess already resolved the workspace, reads from context. Otherwise fa
internal/server/server.go:1954
↓ 105 callersFunctionWithDispatchInput
WithDispatchInput returns ctx decorated with the original MCP tool- call JSON input map. Called from the registry's tool handler before invoking Dispa
internal/mcp/dispatch.go:55
↓ 103 callersMethodDispatch
Dispatch satisfies the Dispatcher interface. cliArgs are accepted for interface compatibility but ignored — HTTPHandlerDispatcher reads the structured
internal/mcp/dispatch_http.go:262
↓ 101 callersFunctionnow
()
internal/store/store.go:846
↓ 100 callersMethodCreateCollection
(workspaceID string, input models.CollectionCreate)
internal/store/collections.go:36
↓ 100 callersMethodError
()
internal/cli/client.go:1115
↓ 97 callersMethodEncode
Encode writes img to w in the given format ("png" / "jpeg"). JPEG is encoded at quality 85 — small enough for thumbnails, high enough that pixel-level
internal/attachments/processor.go:62
↓ 96 callersFunctioncreateTestUser
(t *testing.T, s *Store, email, name, password string)
internal/store/users_test.go:10
↓ 93 callersMethodHeader
()
internal/server/handlers_events_test.go:474
↓ 91 callersMethodGetItem
(id string)
internal/store/items.go:539
↓ 89 callersFunctiongetClient
()
cmd/pad/main.go:236
↓ 88 callersMethodget
( url: string, options?: { headers?: Record<string, string> } )
web/e2e/workspace-bundle-roundtrip.spec.ts:67
↓ 88 callersFunctionparseTime
(s string)
internal/store/store.go:863
↓ 84 callersMethodWrite
(p []byte)
internal/mcp/resources.go:122
↓ 80 callersFunctioncreateItem
helper: create an item in a collection and return the parsed Item
internal/server/handlers_dashboard_test.go:13
↓ 80 callersFunctioncurrentUser
currentUser returns the authenticated user from the request context, or nil if no user is authenticated.
internal/server/middleware_auth.go:452
↓ 79 callersMethodok
ok issues the preflight as the owner and requires a 200.
internal/server/handlers_items_copy_preflight_test.go:196
↓ 76 callersFunctiongetWorkspace
()
cmd/pad/main.go:245
↓ 75 callersMethodUpdateItem
(id string, input models.ItemUpdate)
internal/store/items.go:1958
↓ 74 callersFunctionnewID
()
internal/store/store.go:842
↓ 68 callersMethodGetUser
GetUser retrieves a user by ID.
internal/store/users.go:121
↓ 66 callersFunctionNewMemoryOpBus
NewMemoryOpBus returns a ready-to-use in-process bus.
internal/collab/memory_bus.go:29
↓ 66 callersMethodWriteHeader
(status int)
internal/mcp/resources_http.go:383
↓ 65 callersFunctionPrintJSON
PrintJSON prints any value as indented (human-readable) JSON.
internal/cli/format.go:420
↓ 65 callersFunctiondecodeJSON
2 MiB decodeJSON reads and unmarshals the JSON body into v. Wraps the body in http.MaxBytesReader so an attacker can't exhaust memory by POSTing a mul
internal/server/server.go:1930
↓ 64 callersMethodHeader
()
internal/mcp/resources_http.go:376
↓ 63 callersMethodClose
Close shuts down the bus. All subscriber channels are closed under the same write-lock that gates Publish/Subscribe so a final inflight Publish can't
internal/collab/memory_bus.go:174
↓ 63 callersMethodStat
Stat returns the size in bytes of the blob identified by key. If key is unknown, the returned error wraps ErrNotFound.
internal/attachments/store.go:49
↓ 61 callersFunctionnewCopyPreflightFixture
(t *testing.T)
internal/server/handlers_items_copy_preflight_test.go:81
↓ 60 callersMethoddelete
(path string)
internal/cli/client.go:1621
↓ 59 callersMethodStop
Stop waits for all background goroutines started via goAsync to finish AND drains the rate-limiter cleanup goroutines spawned at construction time (BU
internal/server/server.go:357
↓ 59 callersFunctionloginTestUser
loginTestUser creates a user + session, returns the user + the raw session token suitable for AddCookie.
internal/server/handlers_oauth_test.go:2359
↓ 56 callersMethodCreateSession
CreateSession generates a random session token, stores its SHA-256 hash, and returns the plaintext token (prefixed with "padsess_"). The plaintext is
internal/store/sessions.go:26
↓ 56 callersMethodListItems
(workspaceID string, params models.ItemListParams)
internal/store/items.go:1008
↓ 56 callersMethodSetCloudMode
SetCloudMode enables cloud mode with the shared sidecar secret(s). Accepts a comma-separated list of secrets for rotation support: "new-key,old-key" —
internal/server/server.go:472
↓ 55 callersFunctionNewRoomManager
NewRoomManager wires the store + bus together with production defaults.
internal/collab/manager.go:248
↓ 54 callersMethodCreateAPIToken
CreateAPIToken generates a new API token owned by a user, optionally scoped to a workspace. The plaintext token is returned in the response and is nev
internal/store/api_tokens.go:20
↓ 54 callersMethodError
()
internal/mcp/catalog.go:258
↓ 54 callersFunctionclose
(result: CropResult | null)
web/src/lib/components/editor/attachment-crop-modal.ts:310
↓ 54 callersFunctiondelete
* Soft-delete an attachment by ID. The blob on disk stays put * (content-addressed dedupe means the same hash may still be * referenced) — orpha
web/src/lib/api/client.ts:2245
↓ 53 callersMethodGetWorkspaceBySlug
(slug string)
internal/store/workspaces.go:126
↓ 52 callersMethodrequest
* Open the confirmation and resolve when the user answers — the descriptor's * `ctx.confirmDelete`. A no-op that resolves false when the caller may
web/src/lib/attachments/surfaceDeleteConfirm.svelte.ts:54
↓ 52 callersFunctionrequireMinRole
requireMinRole checks role and writes a 403 if insufficient. Returns true if the request should continue, false if it was rejected.
internal/server/middleware_auth.go:756
↓ 51 callersMethodWriteHeader
(_ int)
internal/server/handlers_events_test.go:481
↓ 49 callersFunctionNewWorkspaceState
NewWorkspaceState returns a state pre-seeded with `initial`. Pass an empty string to start with no default — the first tool call will then need an exp
internal/mcp/workspace.go:57
↓ 49 callersFunctionrealPNG
realPNG returns a tiny but real PNG (1x1 transparent) so image.DecodeConfig succeeds.
internal/server/handlers_attachments_test.go:66
↓ 47 callersFunctionoauthEnabledTestServer
oauthEnabledTestServer builds a Server with cloud mode + a real internal/oauth.Server backed by the test store. Returns the Server so each test can dr
internal/server/handlers_oauth_test.go:54
↓ 47 callersFunctionregisterTestClient
===================================================================== Helpers ===================================================================== re
internal/server/handlers_oauth_test.go:2332
↓ 46 callersMethodpost
( url: string, options: { headers?: Record<string, string>; data?: unknown; multipart?: unknown } )
web/e2e/workspace-bundle-roundtrip.spec.ts:63
↓ 45 callersMethodGetBacklinks
GetBacklinks returns the items in `workspaceID` that contain a resolved `[[...]]` reference to `targetItemID`. Phase 1 only returns ref-kind backlinks
internal/store/wiki_links.go:902
↓ 45 callersMethodSetMemberCollectionAccess
SetMemberCollectionAccess updates a member's collection_access mode and replaces their specific collection grants atomically.
internal/store/workspace_members.go:252
↓ 45 callersFunctioncancel
()
web/src/lib/items/contentSaver.svelte.ts:68
↓ 43 callersMethodCreateItemGrant
--- Item Grants --- CreateItemGrant creates a direct grant on an item for a user.
internal/store/grants.go:101
↓ 43 callersFunctiondoRequestWithHeaders
doRequestWithHeaders is a thin variant of doRequest that lets a test set arbitrary request headers (e.g. Authorization) without spinning up a real aut
internal/server/handlers_items_test.go:19
↓ 42 callersFunctionNewClientFromURL
NewClientFromURL creates a client from a full base URL (e.g., "https://app.getpad.dev").
internal/cli/client.go:41
↓ 42 callersFunctionnewCollabTestServer
newCollabTestServer wires up an httptest server whose only handler upgrades the inbound WS, registers it with the manager, and waits for the session t
internal/collab/manager_test.go:260
↓ 42 callersMethodvisibleCollectionIDs
visibleCollectionIDs returns the set of collection IDs the current user can see in the given workspace. Returns nil if the user has "all" access (no f
internal/server/server.go:2016
↓ 41 callersFunctioncurrentUserID
currentUserID returns the authenticated user's ID, or empty string.
internal/server/middleware_auth.go:514
↓ 39 callersMethodDeleteItem
DeleteItem soft-deletes the item by stamping deleted_at and bumping the workspace-scoped seq so delta-sync clients see the tombstone. The seq bump use
internal/store/items.go:2650
↓ 39 callersMethodGetUserByEmail
GetUserByEmail retrieves a user by email address (case-insensitive).
internal/store/users.go:133
↓ 38 callersMethodClose
Close stops every active room AND blocks until every in-flight Join goroutine has returned. After Close, Join is undefined — callers must coordinate s
internal/collab/manager.go:1338
↓ 38 callersMethodDB
DB returns the underlying *sql.DB (for use in migrations/testing).
internal/store/store.go:75
↓ 38 callersFunctiondoMultipartUpload
(srv *Server, slug, filename string, body []byte)
internal/server/handlers_attachments_test.go:50
↓ 38 callersMethodreq
req builds a request from A to B with the standard actor.
internal/store/attachments_copy_plan_test.go:85
↓ 38 callersMethodset
(workspaceID string, info *store.WorkspaceStorageInfo)
internal/server/handlers_storage.go:77
next →1–100 of 7,856, ranked by callers