MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions9,998 in github.com/PerpetualSoftware/pad

↓ 917 callersMethodString
()
internal/server/token_reaper_test.go:27
↓ 684 callersFunctiontestServer
(t *testing.T)
internal/server/server_test.go:19
↓ 601 callersFunctionmake
(id: string)
web/e2e/attachment-viewer-modal.spec.ts:225
↓ 546 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
↓ 505 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
↓ 498 callersMethodq
q rebinds a query to the store's dialect (converts "?" to "$1", "$2", etc. for PostgreSQL).
internal/store/store.go:950
↓ 399 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
↓ 387 callersFunctiondoRequest
(srv *Server, method, path string, body interface{})
internal/server/server_test.go:40
↓ 375 callersFunctioncreateTestWorkspace
(t *testing.T, s *Store, name string)
internal/store/store_test.go:248
↓ 371 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
↓ 358 callersMethodScan
(dest ...interface{})
internal/store/api_tokens.go:303
↓ 351 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
↓ 334 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:302
↓ 317 callersMethodSet
Set replaces the session workspace. Pass an empty string to clear.
internal/mcp/workspace.go:79
↓ 304 callersFunctionparseJSON
(t *testing.T, rr *httptest.ResponseRecorder, v interface{})
internal/server/server_test.go:64
↓ 295 callersMethodExec
(query string, args ...any)
internal/store/store.go:544
↓ 246 callersFunctioncreateTestCollection
--- Collection helpers ---
internal/store/items_test.go:14
↓ 240 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:46
↓ 239 callersFunctioncreateTestItem
(t *testing.T, s *Store, workspaceID, collectionID, title, content string)
internal/store/items_test.go:26
↓ 234 callersFunctioncreateWSWithCollections
createWSWithCollections creates a workspace and returns its slug. The workspace will have default collections seeded automatically.
internal/server/handlers_items_test.go:40
↓ 232 callersMethodError
()
internal/server/handlers_collab.go:568
↓ 223 callersFunctionwriteError
(w http.ResponseWriter, status int, code, message string)
internal/server/server.go:2157
↓ 218 callersMethodQueryRow
(query string, args ...any)
internal/store/store.go:564
↓ 209 callersMethodServeHTTP
(w http.ResponseWriter, r *http.Request)
internal/server/server.go:2085
↓ 198 callersMethodCreateUser
CreateUser creates a new user with a hashed password.
internal/store/users.go:85
↓ 197 callersMethodQuery
(query string, args ...any)
internal/store/store.go:563
↓ 196 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:2169
↓ 193 callersFunctionwriteJSON
(w http.ResponseWriter, status int, v interface{})
internal/server/server.go:2150
↓ 187 callersMethodAddWorkspaceMember
AddWorkspaceMember adds a user to a workspace with the given role. Transactional as of TASK-2658 — it was a bare Exec before. The membership row and
internal/store/workspace_members.go:30
↓ 181 callersMethodError
()
internal/cli/client.go:1383
↓ 169 callersMethodCreateItem
(workspaceID, collectionID string, input models.ItemCreate)
internal/store/items.go:177
↓ 164 callersMethodCreateWorkspace
(input models.WorkspaceCreate)
internal/store/workspaces.go:68
↓ 149 callersMethodString
()
internal/events/bus.go:171
↓ 146 callersFunctionbootstrapFirstUser
(t *testing.T, srv *Server, email, name string)
internal/server/handlers_auth_test.go:15
↓ 133 callersMethodError
()
internal/store/items.go:1973
↓ 127 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:36
↓ 125 callersFunctiondoRequestWithCookie
doRequestWithCookie is like doRequest but adds a session cookie.
internal/server/handlers_auth_test.go:478
↓ 124 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
↓ 123 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
↓ 119 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
↓ 115 callersMethodPrintf
(_ context.Context, format string, v ...interface{})
cmd/pad/redis_logger.go:39
↓ 114 callersMethodDispatch
Dispatch satisfies the Dispatcher interface. cliArgs are accepted for interface compatibility but ignored — HTTPHandlerDispatcher reads the structured
internal/mcp/dispatch_http.go:276
↓ 111 callersFunctionnow
()
internal/store/store.go:958
↓ 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:2259
↓ 109 callersMethodCreateCollection
(workspaceID string, input models.CollectionCreate)
internal/store/collections.go:37
↓ 109 callersMethodHeader
()
internal/server/handlers_events_test.go:474
↓ 104 callersMethodAddr
Addr returns the host:port listen address.
internal/config/config.go:629
↓ 104 callersFunctioncreateTestUser
(t *testing.T, s *Store, email, name, password string)
internal/store/users_test.go:10
↓ 104 callersMethodget
( url: string, options?: { headers?: Record<string, string> } )
web/e2e/workspace-bundle-roundtrip.spec.ts:67
↓ 102 callersFunctioncancel
()
web/src/lib/items/contentSaver.svelte.ts:68
↓ 101 callersFunctionclose
(result: CropResult | null)
web/src/lib/components/editor/attachment-crop-modal.ts:310
↓ 99 callersMethodGetItem
(id string)
internal/store/items.go:581
↓ 96 callersMethodUpdateItem
(id string, input models.ItemUpdate, opts ...MutationOption)
internal/store/items.go:1956
↓ 93 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:50
↓ 90 callersMethodWriteHeader
(status int)
internal/mcp/resources_http.go:383
↓ 90 callersFunctiongetClient
()
cmd/pad/main.go:237
↓ 89 callersMethodWrite
(p []byte)
internal/mcp/resources.go:122
↓ 87 callersMethodok
ok issues the preflight as the owner and requires a 200.
internal/server/handlers_items_copy_preflight_test.go:196
↓ 86 callersFunctionparseTime
(s string)
internal/store/store.go:975
↓ 85 callersMethodName
Name returns the full Redis key or channel name for a suffix. The suffix is the historical name minus the "pad:" root — "event_seq", "watchevents", "e
internal/redisns/redisns.go:149
↓ 83 callersFunctioncreateItem
helper: create an item in a collection and return the parsed Item
internal/server/handlers_dashboard_test.go:13
↓ 83 callersFunctionnewID
()
internal/store/store.go:954
↓ 80 callersMethodClose
Close shuts down the event bus and cleans up resources.
internal/events/bus.go:276
↓ 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 callersMethodClose
Close shuts the bus down, closing every subscriber channel.
internal/watchevents/watchevents.go:282
↓ 77 callersFunctiongetWorkspace
()
cmd/pad/main.go:246
↓ 74 callersMethodUnsubscribe
Unsubscribe removes a subscriber and closes its channel.
internal/events/bus.go:257
↓ 74 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:2186
↓ 74 callersMethodnow
now reads the bus's clock. The seam is nil in production; tests set it so a 90s threshold can be crossed without sleeping through one.
internal/watchevents/heartbeat.go:125
↓ 74 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
↓ 73 callersMethodHeader
()
internal/mcp/resources_http.go:376
↓ 72 callersFunctionPrintJSON
PrintJSON prints any value as indented (human-readable) JSON.
internal/cli/format.go:441
↓ 71 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:426
↓ 69 callersMethodGetUser
GetUser retrieves a user by ID.
internal/store/users.go:121
↓ 67 callersMethodError
()
internal/mcp/catalog.go:258
↓ 67 callersMethodSubscribe
Subscribe returns a channel that receives every future Notification, with NO replay. There is exactly one logical stream (unlike internal/events.Event
internal/watchevents/watchevents.go:244
↓ 67 callersFunctionnewCopyPreflightFixture
(t *testing.T)
internal/server/handlers_items_copy_preflight_test.go:81
↓ 66 callersFunctionNewMemoryOpBus
NewMemoryOpBus returns a ready-to-use in-process bus.
internal/collab/memory_bus.go:29
↓ 66 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:2331
↓ 64 callersMethoddelete
(path string)
internal/cli/client.go:1969
↓ 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
↓ 62 callersMethodGetWorkspaceBySlug
(slug string)
internal/store/workspaces.go:126
↓ 61 callersMethodSubscribe
Subscribe registers a new subscriber for the given workspace and returns its event channel and its GAP SIGNAL — see SubscribeIfAllowed for what the se
internal/events/bus.go:204
↓ 60 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:557
↓ 60 callersFunctionloginTestUser
loginTestUser creates a user + session, returns the user + the raw session token suitable for AddCookie.
internal/server/handlers_oauth_test.go:2453
↓ 59 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
↓ 59 callersFunctionNew
New creates a new in-memory EventBus with default replay buffer settings.
internal/events/bus.go:652
↓ 58 callersMethodListItems
(workspaceID string, params models.ItemListParams)
internal/store/items.go:1006
↓ 58 callersFunctionNewClientFromURL
NewClientFromURL creates a client from a full base URL (e.g., "https://app.getpad.dev").
internal/cli/client.go:52
↓ 58 callersMethodPublish
Publish assigns the Notification a monotonic ID, stores it in the replay buffer, and fans it out to every live Subscribe channel. ID assignment and bu
internal/watchevents/watchevents.go:216
↓ 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 callersFunctioncreateWSForTest
(t *testing.T, srv *Server)
internal/server/server_test.go:227
↓ 56 callersFunctionrealPNG
realPNG returns a tiny but real PNG (1x1 transparent) so image.DecodeConfig succeeds.
internal/server/handlers_attachments_test.go:68
↓ 55 callersMethodDriver
Driver returns the driver type.
internal/store/dialect.go:20
↓ 55 callersMethodEventsSince
EventsSince returns events for a workspace with IDs greater than sinceID. Used to replay missed events on SSE reconnect (Last-Event-ID). Returns nil
internal/events/bus.go:273
↓ 55 callersFunctionNewRoomManager
NewRoomManager wires the store + bus together with production defaults.
internal/collab/manager.go:248
↓ 55 callersMethodPublish
Publish sends an event to all subscribers for the event's workspace.
internal/events/bus.go:260
↓ 55 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:335
↓ 54 callersMethodWriteHeader
(_ int)
internal/server/handlers_events_test.go:481
↓ 53 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
next →1–100 of 9,998, ranked by callers