Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PerpetualSoftware/pad
/ functions
Functions
11,926 in github.com/PerpetualSoftware/pad
⨍
Functions
11,926
◇
Types & classes
1,272
↓ 1,071 callers
Method
String
()
internal/server/token_reaper_test.go:27
↓ 784 callers
Function
testServer
(t *testing.T)
internal/server/server_test.go:19
↓ 777 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:22
↓ 692 callers
Function
make
(id: string)
web/e2e/attachment-viewer-modal.spec.ts:225
↓ 608 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
↓ 593 callers
Method
q
q rebinds a query to the store's dialect (converts "?" to "$1", "$2", etc. for PostgreSQL).
internal/store/store.go:1171
↓ 541 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
↓ 511 callers
Function
createTestWorkspace
(t *testing.T, s *Store, name string)
internal/store/store_test.go:377
↓ 456 callers
Method
Scan
(dest ...interface{})
internal/store/api_tokens.go:329
↓ 448 callers
Function
doRequest
(srv *Server, method, path string, body interface{})
internal/server/server_test.go:40
↓ 443 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
↓ 425 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
↓ 378 callers
Method
Exec
(query string, args ...any)
internal/store/store.go:763
↓ 362 callers
Method
Add
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
↓ 345 callers
Method
Set
Set replaces the session workspace. Pass an empty string to clear.
internal/mcp/workspace.go:79
↓ 345 callers
Function
createTestItem
(t *testing.T, s *Store, workspaceID, collectionID, title, content string)
internal/store/items_test.go:27
↓ 336 callers
Function
parseJSON
(t *testing.T, rr *httptest.ResponseRecorder, v interface{})
internal/server/server_test.go:64
↓ 332 callers
Function
createTestCollection
--- Collection helpers ---
internal/store/items_test.go:15
↓ 299 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
↓ 291 callers
Method
QueryRow
(query string, args ...any)
internal/store/store.go:783
↓ 259 callers
Method
Error
()
internal/server/handlers_collab.go:463
↓ 255 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:46
↓ 238 callers
Function
writeError
(w http.ResponseWriter, status int, code, message string)
internal/server/server.go:2237
↓ 232 callers
Method
CreateUser
CreateUser creates a new user with a hashed password.
internal/store/users.go:85
↓ 230 callers
Method
Query
(query string, args ...any)
internal/store/store.go:782
↓ 226 callers
Method
CreateItem
(workspaceID, collectionID string, input models.ItemCreate)
internal/store/items.go:199
↓ 226 callers
Method
Error
()
internal/cli/client.go:1400
↓ 214 callers
Method
AddWorkspaceMember
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
↓ 212 callers
Method
ServeHTTP
(w http.ResponseWriter, r *http.Request)
internal/server/server.go:2138
↓ 210 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:2249
↓ 202 callers
Function
writeJSON
(w http.ResponseWriter, status int, v interface{})
internal/server/server.go:2230
↓ 196 callers
Method
Error
()
internal/store/items.go:2123
↓ 178 callers
Method
CreateWorkspace
CreateWorkspace mints a workspace against the pool. Callers already inside a transaction want createWorkspaceQ instead.
internal/store/workspaces.go:88
↓ 160 callers
Method
CreateCollection
(workspaceID string, input models.CollectionCreate)
internal/store/collections.go:39
↓ 160 callers
Function
bootstrapFirstUser
(t *testing.T, srv *Server, email, name string)
internal/server/handlers_auth_test.go:15
↓ 152 callers
Method
String
String renders a suspect the way the CLI reports it.
internal/store/nulscan.go:117
↓ 149 callers
Method
GetItem
(id string)
internal/store/items.go:625
↓ 140 callers
Function
doRequestWithCookie
doRequestWithCookie is like doRequest but adds a session cookie.
internal/server/handlers_auth_test.go:478
↓ 137 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
↓ 137 callers
Method
UpdateItem
(id string, input models.ItemUpdate, opts ...MutationOption)
internal/store/items.go:2098
↓ 134 callers
Method
get
( url: string, options?: { headers?: Record<string, string> } )
web/e2e/workspace-bundle-roundtrip.spec.ts:67
↓ 133 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:36
↓ 128 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
↓ 128 callers
Function
now
()
internal/store/store.go:1179
↓ 125 callers
Function
createTestUser
(t *testing.T, s *Store, email, name, password string)
internal/store/users_test.go:10
↓ 122 callers
Method
Printf
(_ context.Context, format string, v ...interface{})
cmd/pad/redis_logger.go:39
↓ 122 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
↓ 120 callers
Method
Header
()
internal/server/handlers_events_test.go:479
↓ 119 callers
Method
ok
ok issues the preflight as the owner and requires a 200.
internal/server/handlers_items_copy_preflight_test.go:196
↓ 117 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:278
↓ 116 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:2683
↓ 113 callers
Method
Addr
Addr returns the host:port listen address.
internal/config/config.go:629
↓ 113 callers
Function
createItem
helper: create an item in a collection and return the parsed Item
internal/server/handlers_dashboard_test.go:13
↓ 112 callers
Function
close
(result: CropResult | null)
web/src/lib/components/editor/attachment-crop-modal.ts:310
↓ 111 callers
Function
cancel
()
web/src/lib/items/contentSaver.svelte.ts:68
↓ 104 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:50
↓ 98 callers
Function
getClient
()
cmd/pad/main.go:238
↓ 95 callers
Method
Begin
()
internal/store/nultriggers_test.go:535
↓ 94 callers
Method
Driver
Driver returns the driver type.
internal/store/dialect.go:20
↓ 94 callers
Method
Write
(p []byte)
internal/mcp/resources.go:124
↓ 92 callers
Method
WriteHeader
(status int)
internal/mcp/resources_http.go:383
↓ 91 callers
Function
newID
()
internal/store/store.go:1175
↓ 90 callers
Method
Name
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
↓ 87 callers
Function
parseTime
(s string)
internal/store/store.go:1196
↓ 85 callers
Function
currentUser
currentUser returns the authenticated user from the request context, or nil if no user is authenticated.
internal/server/middleware_auth.go:514
↓ 82 callers
Method
ListItems
(workspaceID string, params models.ItemListParams)
internal/store/items.go:1143
↓ 81 callers
Function
getWorkspace
()
cmd/pad/main.go:247
↓ 80 callers
Method
Close
Close shuts down the event bus and cleans up resources.
internal/events/bus.go:276
↓ 80 callers
Method
now
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
↓ 79 callers
Method
Close
Close shuts the bus down, closing every subscriber channel.
internal/watchevents/watchevents.go:282
↓ 79 callers
Function
PrintJSON
PrintJSON prints any value as indented (human-readable) JSON.
internal/cli/format.go:441
↓ 77 callers
Method
Header
()
internal/mcp/resources_http.go:376
↓ 77 callers
Method
delete
(path string)
internal/cli/client.go:2014
↓ 76 callers
Function
NewMemoryOpBus
NewMemoryOpBus returns a ready-to-use in-process bus.
internal/collab/memory_bus.go:29
↓ 76 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:2344
↓ 75 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:2572
↓ 74 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:459
↓ 74 callers
Method
Unsubscribe
Unsubscribe removes a subscriber and closes its channel.
internal/events/bus.go:257
↓ 74 callers
Function
setupWatchTestUser
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
↓ 72 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
↓ 72 callers
Method
Error
()
internal/mcp/catalog.go:258
↓ 72 callers
Method
GetWorkspaceBySlug
(slug string)
internal/store/workspaces.go:166
↓ 69 callers
Method
GetUser
GetUser retrieves a user by ID.
internal/store/users.go:121
↓ 68 callers
Function
newCopyPreflightFixture
(t *testing.T)
internal/server/handlers_items_copy_preflight_test.go:81
↓ 67 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
↓ 67 callers
Method
Subscribe
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 callers
Method
baseBody
()
internal/server/handlers_items_copy_preflight_test.go:209
↓ 66 callers
Method
SetMemberCollectionAccess
SetMemberCollectionAccess updates a member's collection_access mode and replaces their specific collection grants atomically.
internal/store/workspace_members.go:293
↓ 64 callers
Function
NewRoomManager
NewRoomManager wires the store + bus together with production defaults.
internal/collab/manager.go:248
↓ 64 callers
Function
createWSForTest
(t *testing.T, srv *Server)
internal/server/server_test.go:227
↓ 63 callers
Method
DB
DB returns the underlying *sql.DB (for use in migrations/testing).
internal/store/store.go:232
↓ 63 callers
Function
dispatchPadItem
dispatchPadItem runs one pad_item call through the fan-out handler and returns the fake dispatcher plus the tool result.
internal/mcp/catalog_item_fields_test.go:56
↓ 62 callers
Function
New
New creates a new in-memory EventBus with default replay buffer settings.
internal/events/bus.go:652
↓ 61 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
↓ 61 callers
Method
Subscribe
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
↓ 61 callers
Function
relationFixture
relationFixture builds the Cars/Colors shape from IDEA-2856 and returns the workspace, the two collections and one live colour.
internal/store/relation_referents_test.go:30
↓ 60 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:593
↓ 60 callers
Function
loginTestUser
loginTestUser creates a user + session, returns the user + the raw session token suitable for AddCookie.
internal/server/handlers_oauth_test.go:2453
↓ 59 callers
Method
post
( url: string, options: { headers?: Record<string, string>; data?: unknown; multipart?: unknown } )
web/e2e/workspace-bundle-roundtrip.spec.ts:63
↓ 58 callers
Function
NewClientFromURL
NewClientFromURL creates a client from a full base URL (e.g., "https://app.getpad.dev").
internal/cli/client.go:52
next →
1–100 of 11,926, ranked by callers