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
↓ 28 callers
Method
Resolve
Resolve returns the store responsible for key, or an error if no matching backend is registered. The key format is "<prefix>:<rest>".
internal/attachments/registry.go:63
↓ 28 callers
Method
SubscribeIfAllowed
SubscribeIfAllowed atomically checks the per-workspace subscriber limit and, only if it is satisfied, subscribes in the same critical section. Return
internal/events/bus.go:235
↓ 28 callers
Function
ValidateFields
ValidateFields checks field values against the collection schema. It validates required fields are present, types are correct, and select values are w
internal/items/validate.go:78
↓ 28 callers
Function
errorHandler
errorHandler fails the test if invoked. Used to assert that a code path doesn't hit the handler at all.
internal/mcp/dispatch_http_advanced_test.go:891
↓ 28 callers
Function
mkUser
(t *testing.T, srv *Server, email string)
internal/server/handlers_storage_delete_authz_test.go:107
↓ 28 callers
Function
parseTimePtr
(s *string)
internal/store/store.go:1201
↓ 28 callers
Function
resolve
(id: string)
web/src/lib/collections/relationGroups.test.ts:57
↓ 27 callers
Method
CreateComment
CreateComment adds a new comment to an item. userID is the authenticated user authoring the comment (empty for agent/system comments); it's stored as
internal/store/comments.go:18
↓ 27 callers
Method
addEventListener
(type: 'toolchange', listener: (ev: Event) => void)
web/src/lib/webmcp/types.d.ts:78
↓ 27 callers
Method
attach
attach creates an original attachment in ws and returns it.
internal/store/attachments_copy_plan_test.go:37
↓ 27 callers
Function
newCrossWSFixture
(t *testing.T)
internal/server/authz_cross_workspace_test.go:50
↓ 27 callers
Function
newMiniredisBus
(t *testing.T, size int)
internal/watchevents/redis_bus_integration_test.go:28
↓ 27 callers
Function
seedDoc
( fixture: SuiteFixture, request: APIRequestContext, titlePrefix = 'Collab persistence', fields: Record<st
web/e2e/lib/collab-helpers.ts:47
↓ 26 callers
Method
Dispatch
(ctx context.Context, cmdPath []string, cliArgs []string)
internal/mcp/dispatch.go:40
↓ 26 callers
Method
Query
(query string, args ...any)
internal/store/items.go:4737
↓ 26 callers
Function
actorFromRequest
actorFromRequest derives actor and source from the request's auth context. Actor is "user" or "agent" (determined by X-Pad-Agent header). Source is "w
internal/server/handlers_documents.go:355
↓ 26 callers
Function
armReminder
(t *testing.T, s *Store, wsID, itemID, at string)
internal/store/reminders_test.go:26
↓ 26 callers
Function
cloudAdminReq
cloudAdminReq is a small helper that builds a request with optional JSON body and the caller-chosen headers.
internal/server/cloud_admin_gate_test.go:19
↓ 26 callers
Function
isBearerAuth
isBearerAuth reports whether the request was authenticated via an Authorization: Bearer header rather than a browser session cookie. True for: PATs on
internal/server/middleware_auth.go:568
↓ 26 callers
Function
newHeartbeatBus
newHeartbeatBus builds a phase-1 bus (recognises heartbeats, publishes none) on a hand-driven clock, with an observer attached.
internal/events/redis_heartbeat_test.go:43
↓ 25 callers
Method
AuthorizeCrossWorkspaceEdit
AuthorizeCrossWorkspaceEdit decides whether the caller may WRITE the scoped resource in a workspace OTHER than the request's own. It runs every step
internal/server/authz_cross_workspace.go:509
↓ 25 callers
Method
D
D returns the store's dialect for building backend-specific SQL.
internal/store/store.go:229
↓ 25 callers
Function
NewRedisBus
NewRedisBus creates a new Redis-backed EventBus. The provided redis.Client should already be configured and connected.
internal/events/redis_bus.go:803
↓ 25 callers
Method
ResolveItem
ResolveItem looks up an item by UUID, PREFIX-NUMBER ref (e.g. "IDEA-15"), or slug. UUID is tried first, then ref, then slug. ResolveItem maps a caller
internal/store/items.go:827
↓ 25 callers
Method
ServeHTTP
(w http.ResponseWriter, r *http.Request)
internal/mcp/dispatch_http_test.go:44
↓ 25 callers
Function
classifyHTTPStatus
classifyHTTPStatus is the legacy entry point preserved for callers that don't know their resource kind. New callers should use classifyHTTPStatusKind
internal/mcp/errors.go:804
↓ 25 callers
Method
currentGen
NOTE: callerIsGone already exists in this package, added by BUG-2751 for the resume settle path, and is reused here rather than duplicated. Its reason
internal/watchevents/heartbeat.go:515
↓ 25 callers
Function
fetchTimeline
(t *testing.T, srv *Server, wsSlug, itemSlug, query string)
internal/server/handlers_timeline_structured_test.go:49
↓ 25 callers
Function
newTestRedisBus
(t *testing.T)
internal/events/redis_resume_coverage_test.go:11
↓ 25 callers
Method
post
(path string, body interface{}, result interface{})
internal/cli/client.go:1974
↓ 25 callers
Method
record
* Claim what is now on screen. Recording a token whose key is null (an * un-addressable view) correctly claims nothing.
web/src/lib/attachments/viewFence.ts:183
↓ 25 callers
Method
seed
seed creates an item in `tasks` with the given fields blob, writing it through the STORE so a value the doors would refuse can still be planted. That
internal/server/relation_referents_doors_test.go:96
↓ 25 callers
Function
sessionCookieName
sessionCookieName returns the session cookie name. When running over TLS (secureCookies=true), the __Host- prefix is used to prevent subdomain cookie
internal/server/handlers_auth.go:45
↓ 25 callers
Function
strPtr
(s string)
internal/store/timeline_pagination_test.go:191
↓ 24 callers
Method
BoolToInt
BoolToInt converts a Go bool to a query parameter value. SQLite: 0/1 (integers) PostgreSQL: true/false (native booleans)
internal/store/dialect.go:85
↓ 24 callers
Method
CreateCollectionGrant
--- Collection Grants --- CreateCollectionGrant creates a direct grant on a collection for a user.
internal/store/grants.go:13
↓ 24 callers
Function
DefaultConfig
()
internal/config/config.go:291
↓ 24 callers
Method
SubscribeAndReplaySince
SubscribeAndReplaySince atomically subscribes AND captures every buffered notification with ID > sinceID, under the SAME lock (codex round 1 finding 3
internal/watchevents/watchevents.go:270
↓ 24 callers
Function
assertDenied
(t *testing.T, got CrossWorkspaceAccess, want CrossWorkspaceDenialReason, label string)
internal/server/authz_cross_workspace_test.go:176
↓ 24 callers
Function
bearerCall
(t *testing.T, srv *Server, method, path, token string, body []byte)
internal/server/handlers_watches_test.go:62
↓ 24 callers
Method
close
()
web/src/lib/services/sseFirstConnectSync.svelte.test.ts:42
↓ 24 callers
Function
connectWatchStream
connectWatchStream connects to GET /api/v1/events/stream with a Bearer token and returns a channel of parsed SSE events. UNARMED — the S1 legacy shape
internal/server/handlers_watch_events_test.go:37
↓ 24 callers
Function
doAuthedRequest
doAuthedRequest is like doRequest but with a session cookie + the matching User-Agent attached (SessionAuth UA-binding, see middleware_auth.go:186).
internal/server/handlers_oauth_test.go:2473
↓ 24 callers
Function
emptyPreflight
emptyPreflight is the everything-is-zero case. Its whole job is to prove "nothing to report" renders as an explicit zero rather than as silence.
cmd/pad/item_copy_test.go:65
↓ 24 callers
Function
errCode
(t *testing.T, rr *httptest.ResponseRecorder)
internal/server/handlers_items_copy_preflight_test.go:216
↓ 24 callers
Function
nowTS
nowTS is the instant a tick would pass in. Taken well after `past` and well before `future`, so the two fixtures sit on opposite sides of it with no d
internal/store/reminders_test.go:44
↓ 23 callers
Method
CreateActivity
(a models.Activity)
internal/store/activities.go:65
↓ 23 callers
Method
CreateActivityDebounced
A non-nil error is always paired with an EMPTY id (BUG-2779). Neither this function nor CreateActivity returns a usable-looking handle beside a failur
internal/store/activities.go:100
↓ 23 callers
Function
CrossWorkspaceItemScope
CrossWorkspaceItemScope scopes the check to one already-loaded item. Collection visibility is checked first and item-level grants second, in that orde
internal/server/authz_cross_workspace.go:338
↓ 23 callers
Function
Encode
Encode serializes an Artifact to its portable on-disk form: --- <yaml frontmatter> --- <body> Output is deterministic: two Encode calls on the
internal/artifact/encode.go:23
↓ 23 callers
Function
NewErrorResult
NewErrorResult packages an ErrorPayload as an MCP CallToolResult with IsError=true. Both the JSON envelope and a human-readable summary are returned:
internal/mcp/errors.go:253
↓ 23 callers
Method
Value
()
internal/store/nulguard_test.go:628
↓ 23 callers
Function
createTestWorkspace
createTestWorkspace creates a workspace via API and returns its slug.
internal/server/handlers_events_test.go:118
↓ 23 callers
Function
handler
(e: Event)
web/src/lib/components/items/ItemPicker.svelte.test.ts:855
↓ 23 callers
Function
newCopyRelationFixtureWith
newCopyRelationFixtureWith builds the relation fixture with two knobs the default constructor does not need: a `default` on the DESTINATION's relation
internal/server/handlers_items_copy_relation_test.go:308
↓ 23 callers
Function
outboxEventsFor
Tests for the transactional event outbox (SPEC-3 §choke point, TASK-2658). The load-bearing case here is the DISJOINT-DELTA RULE (SPEC-3 v1.3): canon
internal/store/event_outbox_test.go:25
↓ 23 callers
Method
requireEditPermission
requireEditPermission checks if the user has edit access to the given item. For regular members (editor/owner), this uses the standard role check. For
internal/server/server.go:3185
↓ 22 callers
Method
IsEmailVerified
IsEmailVerified returns true if the user's email address has been verified. Mirrors IsDisabled: a non-empty EmailVerifiedAt timestamp means verified,
internal/models/user.go:42
↓ 22 callers
Method
ResolveItemIncludeDeleted
ResolveItemIncludeDeleted is like ResolveItem but includes soft-deleted items.
internal/store/items.go:870
↓ 22 callers
Method
call
call issues the preflight exactly as the router would, with the caller's auth surface described by o. The workspace-A role and resolved ID are stashed
internal/server/handlers_items_copy_preflight_test.go:126
↓ 22 callers
Method
fanOutLocally
gen is the subscription this notification arrived on, or currentGen() for a caller that is not the receive loop. CHECKED HERE, under the lock that AP
internal/watchevents/redis_bus.go:1442
↓ 22 callers
Function
isolatedTestClient
isolatedTestClient returns an HTTP client with a transport of its own. Outbound requests in this package's tests go through it — or through the httpte
internal/server/isolated_client_test.go:55
↓ 22 callers
Method
member
(email, username, wsRole string, ws *models.Workspace)
internal/server/authz_cross_workspace_test.go:123
↓ 22 callers
Function
waitElectable
waitElectable polls until the room for itemID has at least n conns that pickApplier would actually elect — writable, anchored (replayDone), not frozen
internal/collab/manager_test.go:306
↓ 21 callers
Method
AuthorizeCrossWorkspaceRead
AuthorizeCrossWorkspaceRead decides whether the caller may READ the scoped resource in a workspace OTHER than the request's own. workspaceSlugOrID ma
internal/server/authz_cross_workspace.go:459
↓ 21 callers
Method
BaseURL
BaseURL returns the configured base URL.
internal/email/sender.go:94
↓ 21 callers
Function
BuildCLIArgs
( cmdInfo cmdhelp.Command, input map[string]any, sessionWorkspace string, rootFlags map[string]string, )
internal/mcp/dispatch.go:406
↓ 21 callers
Method
CopyItemAcrossWorkspaces
CopyItemAcrossWorkspaces copies one item from its workspace into another, atomically. THE LOCK ORDER. Changed only deliberately, and stated here beca
internal/store/items_cross_workspace_copy.go:451
↓ 21 callers
Function
CrossWorkspaceCollectionScope
CrossWorkspaceCollectionScope scopes the check to one collection — creating into it, or disclosing its schema. Visibility here is FULL-collection-acc
internal/server/authz_cross_workspace.go:354
↓ 21 callers
Function
GetTemplate
GetTemplate returns the workspace template with the given name, or nil if no template with that name exists.
internal/collections/templates.go:1051
↓ 21 callers
Function
New
(s *store.Store)
internal/server/server.go:518
↓ 21 callers
Function
NewMemorySessionPresence
NewMemorySessionPresence returns an empty in-process registry.
internal/server/session_presence.go:343
↓ 21 callers
Function
NewSQLite
NewSQLite returns a *store.Store backed by a fresh SQLite file in t.TempDir(), fully migrated. See the package doc for the template+copy mechanism. St
internal/store/storetest/storetest.go:54
↓ 21 callers
Method
Publish
Publish broadcasts an event to every subscriber whose itemID matches event.ItemID. Non-blocking: full subscriber channels drop the event with a warnin
internal/collab/bus.go:108
↓ 21 callers
Method
QueryRow
(query string, args ...any)
internal/store/items.go:3859
↓ 21 callers
Method
Start
Start begins probing in the background. It runs one probe SYNCHRONOUSLY before returning, so a server that has finished starting has a real answer rat
internal/server/redis_health.go:142
↓ 21 callers
Function
argsContainPair
(args []string, flag, value string)
internal/mcp/catalog_item_fields_test.go:73
↓ 21 callers
Function
buildSyntheticTree
buildSyntheticTree returns a small cobra tree exercising the shapes the emitter has to handle: subgroups, leaf commands with positional args, flags of
internal/cmdhelp/json_test.go:26
↓ 21 callers
Method
cycleIdleSubscriptions
cycleIdleSubscriptions ends coverage for every workspace whose subscription has received nothing for idleTimeout, and REPLACES that subscription. DRO
internal/events/redis_heartbeat.go:464
↓ 21 callers
Function
newCopyFixture
(t *testing.T)
internal/store/items_cross_workspace_copy_test.go:34
↓ 21 callers
Function
newHeartbeatBus
(t *testing.T, publishHeartbeat bool)
internal/watchevents/heartbeat_test.go:37
↓ 21 callers
Function
registryEnv
registryEnv gives a test a fresh HOME (so ~/.pad/sessions is empty) and a clean session environment, returning the sessions dir.
internal/cli/session_registry_test.go:18
↓ 21 callers
Method
req
()
internal/store/items_cross_workspace_copy_test.go:47
↓ 21 callers
Function
validationFailedResult
───────────────────────────────────────────────────────────────────── Helpers for non-HTTP error paths (TASK-1077 — replace plain-string NewToolResult
internal/mcp/errors.go:1306
↓ 21 callers
Function
workspaceRole
workspaceRole returns the user's role in the current workspace, as set by RequireWorkspaceAccess. Returns empty string if not set.
internal/server/middleware_auth.go:752
↓ 20 callers
Method
CreateOAuthClient
============================================================ Clients (RFC 7591 — Dynamic Client Registration) ========================================
internal/store/oauth.go:79
↓ 20 callers
Method
CreateOAuthConnection
CreateOAuthConnection inserts a new connection row. Idempotent in the sense that callers should INSERT once per /authorize/decide; if the same request
internal/store/oauth_connections.go:216
↓ 20 callers
Method
GetDocument
(id string)
internal/store/documents.go:217
↓ 20 callers
Method
MigrateRelationReferents
MigrateRelationReferents is the ONE decision the four migrate doors share (PLAN-2857 U1 / TASK-2878). Same-workspace move, bulk move, cross-workspace
internal/store/relation_referents.go:1252
↓ 20 callers
Function
NewDispatcher
NewDispatcher creates a Dispatcher with the given store. The delivery client enforces the SSRF guard at connect time, not just at parse time: its dia
internal/webhooks/dispatcher.go:195
↓ 20 callers
Function
NewSession
NewSession constructs a Session with the given subject (pad user ID). Returns a non-nil DefaultSession so the embedded methods don't panic on a zero-v
internal/oauth/session.go:49
↓ 20 callers
Function
ParseCollectionTraits
ParseCollectionTraits decodes a stored traits JSON blob. An empty or "null" blob yields the zero value with no error — a collection that declares no t
internal/models/collection_traits.go:176
↓ 20 callers
Method
ResolveRelationReferents
ResolveRelationReferents canonicalises every `relation` value in fieldMap to the target item's ID and reports the ones that cannot be resolved. It MU
internal/store/relation_referents.go:202
↓ 20 callers
Method
Subscribe
Subscribe registers a subscriber for the given item and returns a buffered channel of OpEvents. Caller is responsible for calling Unsubscribe (typical
internal/collab/bus.go:98
↓ 20 callers
Method
callCopy
Tests for the mutating cross-workspace copy (PLAN-2357 / TASK-2365). The fixture is the PREFLIGHT's, deliberately and not for convenience: the headli
internal/server/handlers_items_copy_test.go:50
↓ 20 callers
Function
contextWithResolvedWorkspaceIDForTest
(ctx context.Context, wsID string)
internal/server/authz_cross_workspace_test.go:23
↓ 20 callers
Function
dialCollab
dialCollab opens a WebSocket against the test server's collab endpoint with the given itemID. Returns the connection and the HTTP response. The respon
internal/server/handlers_collab_test.go:40
↓ 20 callers
Function
dispatcherErrorResult
dispatcherErrorResult wraps an internal dispatcher failure (build request, encode body, parse response, marshal merged fields, etc.) into the structur
internal/mcp/errors.go:1324
↓ 20 callers
Function
doRequestWithBearer
doRequestWithBearer dispatches a request with an Authorization: Bearer header set. The existing test helpers in server_test.go don't take a token para
internal/server/middleware_auth_public_paths_test.go:25
↓ 20 callers
Method
logAuditEvent
logAuditEvent logs a non-workspace audit event (e.g. login, logout). Best-effort: errors are silently ignored.
internal/server/handlers_documents.go:438
← previous
next →
201–300 of 11,926, ranked by callers