Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PerpetualSoftware/pad
/ functions
Functions
7,856 in github.com/PerpetualSoftware/pad
⨍
Functions
7,856
◇
Types & classes
959
↓ 861 callers
Method
String
()
internal/server/token_reaper_test.go:27
↓ 541 callers
Function
testServer
(t *testing.T)
internal/server/server_test.go:19
↓ 457 callers
Function
make
(id: string)
web/e2e/attachment-viewer-modal.spec.ts:225
↓ 443 callers
Function
testStore
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 callers
Method
q
q rebinds a query to the store's dialect (converts "?" to "$1", "$2", etc. for PostgreSQL).
internal/store/store.go:838
↓ 380 callers
Method
Close
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 callers
Method
Scan
(dest ...interface{})
internal/store/api_tokens.go:303
↓ 313 callers
Function
doRequest
(srv *Server, method, path string, body interface{})
internal/server/server_test.go:40
↓ 281 callers
Function
createTestWorkspace
(t *testing.T, s *Store, name string)
internal/store/store_test.go:248
↓ 275 callers
Method
Join
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 callers
Function
parseJSON
(t *testing.T, rr *httptest.ResponseRecorder, v interface{})
internal/server/server_test.go:64
↓ 267 callers
Method
Now
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 callers
Method
Exec
(query string, args ...any)
internal/store/store.go:469
↓ 249 callers
Method
Set
Set replaces the session workspace. Pass an empty string to clear.
internal/mcp/workspace.go:79
↓ 237 callers
Method
Run
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 callers
Function
writeError
(w http.ResponseWriter, status int, code, message string)
internal/server/server.go:1901
↓ 211 callers
Method
QueryRow
(query string, args ...any)
internal/store/items.go:3324
↓ 211 callers
Function
createTestCollection
--- Collection helpers ---
internal/store/items_test.go:14
↓ 202 callers
Method
Get
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 callers
Function
createTestItem
(t *testing.T, s *Store, workspaceID, collectionID, title, content string)
internal/store/items_test.go:26
↓ 197 callers
Method
Query
(query string, args ...any)
internal/store/items.go:4182
↓ 195 callers
Function
createWSWithCollections
createWSWithCollections creates a workspace and returns its slug. The workspace will have default collections seeded automatically.
internal/server/handlers_items_test.go:40
↓ 191 callers
Function
writeInternalError
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 callers
Function
writeJSON
(w http.ResponseWriter, status int, v interface{})
internal/server/server.go:1894
↓ 185 callers
Method
Error
()
internal/server/handlers_collab.go:568
↓ 183 callers
Method
ServeHTTP
(w http.ResponseWriter, r *http.Request)
internal/server/server.go:1829
↓ 175 callers
Method
CreateUser
CreateUser creates a new user with a hashed password.
internal/store/users.go:85
↓ 170 callers
Method
AddWorkspaceMember
AddWorkspaceMember adds a user to a workspace with the given role.
internal/store/workspace_members.go:22
↓ 150 callers
Method
CreateWorkspace
(input models.WorkspaceCreate)
internal/store/workspaces.go:68
↓ 141 callers
Method
CreateItem
(workspaceID, collectionID string, input models.ItemCreate)
internal/store/items.go:176
↓ 139 callers
Function
bootstrapFirstUser
(t *testing.T, srv *Server, email, name string)
internal/server/handlers_auth_test.go:15
↓ 124 callers
Function
doRequestWithCookie
doRequestWithCookie is like doRequest but adds a session cookie.
internal/server/handlers_auth_test.go:478
↓ 116 callers
Function
fixedUserResolver
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 callers
Function
testServerWithAttachments
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 callers
Method
Error
()
internal/store/items.go:1975
↓ 110 callers
Method
getWorkspaceID
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 callers
Function
WithDispatchInput
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 callers
Method
Dispatch
Dispatch satisfies the Dispatcher interface. cliArgs are accepted for interface compatibility but ignored — HTTPHandlerDispatcher reads the structured
internal/mcp/dispatch_http.go:262
↓ 101 callers
Function
now
()
internal/store/store.go:846
↓ 100 callers
Method
CreateCollection
(workspaceID string, input models.CollectionCreate)
internal/store/collections.go:36
↓ 100 callers
Method
Error
()
internal/cli/client.go:1115
↓ 97 callers
Method
Encode
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 callers
Function
createTestUser
(t *testing.T, s *Store, email, name, password string)
internal/store/users_test.go:10
↓ 93 callers
Method
Header
()
internal/server/handlers_events_test.go:474
↓ 91 callers
Method
GetItem
(id string)
internal/store/items.go:539
↓ 89 callers
Function
getClient
()
cmd/pad/main.go:236
↓ 88 callers
Method
get
( url: string, options?: { headers?: Record<string, string> } )
web/e2e/workspace-bundle-roundtrip.spec.ts:67
↓ 88 callers
Function
parseTime
(s string)
internal/store/store.go:863
↓ 84 callers
Method
Write
(p []byte)
internal/mcp/resources.go:122
↓ 80 callers
Function
createItem
helper: create an item in a collection and return the parsed Item
internal/server/handlers_dashboard_test.go:13
↓ 80 callers
Function
currentUser
currentUser returns the authenticated user from the request context, or nil if no user is authenticated.
internal/server/middleware_auth.go:452
↓ 79 callers
Method
ok
ok issues the preflight as the owner and requires a 200.
internal/server/handlers_items_copy_preflight_test.go:196
↓ 76 callers
Function
getWorkspace
()
cmd/pad/main.go:245
↓ 75 callers
Method
UpdateItem
(id string, input models.ItemUpdate)
internal/store/items.go:1958
↓ 74 callers
Function
newID
()
internal/store/store.go:842
↓ 68 callers
Method
GetUser
GetUser retrieves a user by ID.
internal/store/users.go:121
↓ 66 callers
Function
NewMemoryOpBus
NewMemoryOpBus returns a ready-to-use in-process bus.
internal/collab/memory_bus.go:29
↓ 66 callers
Method
WriteHeader
(status int)
internal/mcp/resources_http.go:383
↓ 65 callers
Function
PrintJSON
PrintJSON prints any value as indented (human-readable) JSON.
internal/cli/format.go:420
↓ 65 callers
Function
decodeJSON
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 callers
Method
Header
()
internal/mcp/resources_http.go:376
↓ 63 callers
Method
Close
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 callers
Method
Stat
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 callers
Function
newCopyPreflightFixture
(t *testing.T)
internal/server/handlers_items_copy_preflight_test.go:81
↓ 60 callers
Method
delete
(path string)
internal/cli/client.go:1621
↓ 59 callers
Method
Stop
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 callers
Function
loginTestUser
loginTestUser creates a user + session, returns the user + the raw session token suitable for AddCookie.
internal/server/handlers_oauth_test.go:2359
↓ 56 callers
Method
CreateSession
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 callers
Method
ListItems
(workspaceID string, params models.ItemListParams)
internal/store/items.go:1008
↓ 56 callers
Method
SetCloudMode
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 callers
Function
NewRoomManager
NewRoomManager wires the store + bus together with production defaults.
internal/collab/manager.go:248
↓ 54 callers
Method
CreateAPIToken
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 callers
Method
Error
()
internal/mcp/catalog.go:258
↓ 54 callers
Function
close
(result: CropResult | null)
web/src/lib/components/editor/attachment-crop-modal.ts:310
↓ 54 callers
Function
delete
* 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 callers
Method
GetWorkspaceBySlug
(slug string)
internal/store/workspaces.go:126
↓ 52 callers
Method
request
* 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 callers
Function
requireMinRole
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 callers
Method
WriteHeader
(_ int)
internal/server/handlers_events_test.go:481
↓ 49 callers
Function
NewWorkspaceState
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 callers
Function
realPNG
realPNG returns a tiny but real PNG (1x1 transparent) so image.DecodeConfig succeeds.
internal/server/handlers_attachments_test.go:66
↓ 47 callers
Function
oauthEnabledTestServer
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 callers
Function
registerTestClient
===================================================================== Helpers ===================================================================== re
internal/server/handlers_oauth_test.go:2332
↓ 46 callers
Method
post
( url: string, options: { headers?: Record<string, string>; data?: unknown; multipart?: unknown } )
web/e2e/workspace-bundle-roundtrip.spec.ts:63
↓ 45 callers
Method
GetBacklinks
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 callers
Method
SetMemberCollectionAccess
SetMemberCollectionAccess updates a member's collection_access mode and replaces their specific collection grants atomically.
internal/store/workspace_members.go:252
↓ 45 callers
Function
cancel
()
web/src/lib/items/contentSaver.svelte.ts:68
↓ 43 callers
Method
CreateItemGrant
--- Item Grants --- CreateItemGrant creates a direct grant on an item for a user.
internal/store/grants.go:101
↓ 43 callers
Function
doRequestWithHeaders
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 callers
Function
NewClientFromURL
NewClientFromURL creates a client from a full base URL (e.g., "https://app.getpad.dev").
internal/cli/client.go:41
↓ 42 callers
Function
newCollabTestServer
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 callers
Method
visibleCollectionIDs
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 callers
Function
currentUserID
currentUserID returns the authenticated user's ID, or empty string.
internal/server/middleware_auth.go:514
↓ 39 callers
Method
DeleteItem
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 callers
Method
GetUserByEmail
GetUserByEmail retrieves a user by email address (case-insensitive).
internal/store/users.go:133
↓ 38 callers
Method
Close
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 callers
Method
DB
DB returns the underlying *sql.DB (for use in migrations/testing).
internal/store/store.go:75
↓ 38 callers
Function
doMultipartUpload
(srv *Server, slug, filename string, body []byte)
internal/server/handlers_attachments_test.go:50
↓ 38 callers
Method
req
req builds a request from A to B with the standard actor.
internal/store/attachments_copy_plan_test.go:85
↓ 38 callers
Method
set
(workspaceID string, info *store.WorkspaceStorageInfo)
internal/server/handlers_storage.go:77
next →
1–100 of 7,856, ranked by callers