MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions8,091 in github.com/PerpetualSoftware/pad

↓ 898 callersMethodString
()
internal/server/token_reaper_test.go:27
↓ 548 callersFunctiontestServer
(t *testing.T)
internal/server/server_test.go:19
↓ 470 callersFunctionmake
(id: string)
web/e2e/attachment-viewer-modal.spec.ts:225
↓ 446 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
↓ 409 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
↓ 317 callersFunctiondoRequest
(srv *Server, method, path string, body interface{})
internal/server/server_test.go:40
↓ 313 callersMethodScan
(dest ...interface{})
internal/store/api_tokens.go:303
↓ 282 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
↓ 281 callersFunctioncreateTestWorkspace
(t *testing.T, s *Store, name string)
internal/store/store_test.go:248
↓ 274 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
↓ 272 callersFunctionparseJSON
(t *testing.T, rr *httptest.ResponseRecorder, v interface{})
internal/server/server_test.go:64
↓ 260 callersMethodExec
(query string, args ...any)
internal/store/store.go:469
↓ 259 callersMethodSet
Set replaces the session workspace. Pass an empty string to clear.
internal/mcp/workspace.go:79
↓ 255 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
↓ 217 callersFunctionwriteError
(w http.ResponseWriter, status int, code, message string)
internal/server/server.go:1944
↓ 211 callersMethodQueryRow
(query string, args ...any)
internal/store/items.go:3341
↓ 211 callersFunctioncreateTestCollection
--- Collection helpers ---
internal/store/items_test.go:14
↓ 209 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
↓ 206 callersMethodAdd
Add registers a newly-opened stream for userID and returns the session's generated id, which the caller MUST pass to Remove. The identity is whatever
internal/server/session_presence.go:161
↓ 202 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:4199
↓ 196 callersFunctioncreateWSWithCollections
createWSWithCollections creates a workspace and returns its slug. The workspace will have default collections seeded automatically.
internal/server/handlers_items_test.go:40
↓ 193 callersFunctionwriteJSON
(w http.ResponseWriter, status int, v interface{})
internal/server/server.go:1937
↓ 192 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:1956
↓ 187 callersMethodServeHTTP
(w http.ResponseWriter, r *http.Request)
internal/server/server.go:1872
↓ 186 callersMethodError
()
internal/server/handlers_collab.go:568
↓ 183 callersMethodCreateUser
CreateUser creates a new user with a hashed password.
internal/store/users.go:85
↓ 175 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
↓ 147 callersMethodCreateItem
(workspaceID, collectionID string, input models.ItemCreate)
internal/store/items.go:176
↓ 142 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
↓ 112 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
↓ 111 callersMethodError
()
internal/cli/client.go:1217
↓ 110 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
↓ 110 callersMethodError
()
internal/store/items.go:1987
↓ 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:1997
↓ 109 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
↓ 97 callersFunctioncreateTestUser
(t *testing.T, s *Store, email, name, password string)
internal/store/users_test.go:10
↓ 95 callersMethodHeader
()
internal/server/handlers_events_test.go:474
↓ 94 callersMethodGetItem
(id string)
internal/store/items.go:551
↓ 90 callersMethodget
( url: string, options?: { headers?: Record<string, string> } )
web/e2e/workspace-bundle-roundtrip.spec.ts:67
↓ 90 callersFunctiongetClient
()
cmd/pad/main.go:237
↓ 88 callersFunctionparseTime
(s string)
internal/store/store.go:863
↓ 86 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:478
↓ 79 callersMethodok
ok issues the preflight as the owner and requires a 200.
internal/server/handlers_items_copy_preflight_test.go:196
↓ 78 callersMethodUpdateItem
(id string, input models.ItemUpdate)
internal/store/items.go:1970
↓ 78 callersMethodWriteHeader
(status int)
internal/mcp/resources_http.go:383
↓ 77 callersFunctiongetWorkspace
()
cmd/pad/main.go:246
↓ 74 callersFunctionnewID
()
internal/store/store.go:842
↓ 70 callersMethodGetUser
GetUser retrieves a user by ID.
internal/store/users.go:121
↓ 68 callersMethodHeader
()
internal/mcp/resources_http.go:376
↓ 66 callersFunctionNewMemoryOpBus
NewMemoryOpBus returns a ready-to-use in-process bus.
internal/collab/memory_bus.go:29
↓ 66 callersFunctionPrintJSON
PrintJSON prints any value as indented (human-readable) JSON.
internal/cli/format.go:441
↓ 66 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:1973
↓ 65 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
↓ 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
↓ 61 callersFunctionnewCopyPreflightFixture
(t *testing.T)
internal/server/handlers_items_copy_preflight_test.go:81
↓ 60 callersMethoddelete
(path string)
internal/cli/client.go:1723
↓ 59 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:491
↓ 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:376
↓ 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 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
↓ 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:1020
↓ 56 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:2313
↓ 55 callersMethodError
()
internal/mcp/catalog.go:258
↓ 55 callersFunctionNewRoomManager
NewRoomManager wires the store + bus together with production defaults.
internal/collab/manager.go:248
↓ 54 callersFunctionclose
(result: CropResult | null)
web/src/lib/components/editor/attachment-crop-modal.ts:310
↓ 53 callersMethodGetWorkspaceBySlug
(slug string)
internal/store/workspaces.go:126
↓ 53 callersFunctioncancel
()
web/src/lib/items/contentSaver.svelte.ts:68
↓ 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:782
↓ 51 callersMethodWriteHeader
(_ int)
internal/server/handlers_events_test.go:481
↓ 50 callersFunctionNewClientFromURL
NewClientFromURL creates a client from a full base URL (e.g., "https://app.getpad.dev").
internal/cli/client.go:42
↓ 50 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 callersMethodSetMemberCollectionAccess
SetMemberCollectionAccess updates a member's collection_access mode and replaces their specific collection grants atomically.
internal/store/workspace_members.go:252
↓ 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
↓ 44 callersFunctiontextOf
textOf returns the text of the first content block, or empty string. Robust to mcp-go's content-type variations (TextContent, ErrorContent).
internal/mcp/catalog_test.go:328
↓ 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 callersFunctioncurrentUserID
currentUserID returns the authenticated user's ID, or empty string.
internal/server/middleware_auth.go:540
↓ 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 callersFunctionsetupWatchTestUser
setupWatchTestUser seeds a workspace + item, mints a real user + user-scoped Bearer token (mirrors handlers_stars_test.go's pattern), and returns ever
internal/server/handlers_watches_test.go:16
↓ 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:2059
↓ 40 callersMethodGetUserByEmail
GetUserByEmail retrieves a user by email address (case-insensitive).
internal/store/users.go:133
↓ 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:2667
↓ 39 callersMethodset
(workspaceID string, info *store.WorkspaceStorageInfo)
internal/server/handlers_storage.go:77
↓ 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
next →1–100 of 8,091, ranked by callers