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
↓ 37 callers
Method
Driver
Driver returns the driver type.
internal/store/dialect.go:20
↓ 37 callers
Method
baseBody
()
internal/server/handlers_items_copy_preflight_test.go:209
↓ 37 callers
Function
textOf
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
↓ 36 callers
Function
auditMeta
auditMeta safely marshals a map to a JSON string for audit log metadata. Falls back to "{}" on marshal error so audit calls never break.
internal/server/handlers_documents.go:358
↓ 36 callers
Function
newPlanFixture
(t *testing.T)
internal/store/attachments_copy_plan_test.go:24
↓ 36 callers
Method
requireItemVisible
requireItemVisible checks that the item's collection is visible to the requesting user. For guests with item-level grants, also verifies that the spec
internal/server/server.go:2070
↓ 35 callers
Method
CreateAttachment
CreateAttachment inserts an attachment row. id and created_at are generated by the store. The caller is expected to have already written the blob via
internal/store/attachments.go:77
↓ 35 callers
Function
createWSForTest
(t *testing.T, srv *Server)
internal/server/server_test.go:227
↓ 34 callers
Method
get
(path string, result interface{})
internal/cli/client.go:1568
↓ 33 callers
Method
Decode
Decode reads bytes from r and returns the decoded image plus the detected format ("png", "jpeg", "gif", "bmp", "tiff", …). The returned format is the
internal/attachments/processor.go:35
↓ 33 callers
Method
Read
(p []byte)
internal/cli/client_items_copy.go:473
↓ 33 callers
Method
guestResourceFilter
guestResourceFilter returns the full-collection IDs and granted item IDs for the current user if they need item-level grant filtering. Returns nil/nil
internal/server/server.go:2272
↓ 33 callers
Method
plan
(t *testing.T, req AttachmentCopyRequest)
internal/store/attachments_copy_plan_test.go:96
↓ 32 callers
Function
Build
Build returns a cmdhelp Document without serializing it. Callers that need to inspect or further mutate the document (tests, dynamic enum resolvers in
internal/cmdhelp/json.go:83
↓ 32 callers
Method
Rebind
Rebind converts a query with "?" placeholders to the dialect's format. For SQLite this is a no-op. For PostgreSQL, "?" becomes "$1", "$2", etc.
internal/store/dialect.go:28
↓ 32 callers
Function
newTransitionTestWorkspace
(t *testing.T, s *Store)
internal/store/status_transitions_test.go:48
↓ 32 callers
Function
runItemCopy
runItemCopy is the whole command, minus flag binding. Order of operations is load-bearing: 1. Build the request (the SAME body both endpoints take).
cmd/pad/cmd_item.go:1441
↓ 32 callers
Function
s256Challenge
s256Challenge computes the base64url(no-padding, SHA256(verifier)) per RFC 7636 §4.2. PKCE clients use this to derive code_challenge from code_verifie
internal/server/handlers_oauth_test.go:2454
↓ 31 callers
Method
GetCollectionBySlug
(workspaceID, slug string)
internal/store/collections.go:196
↓ 31 callers
Method
ListCollections
(workspaceID string)
internal/store/collections.go:238
↓ 31 callers
Function
baseOpts
()
cmd/pad/item_copy_test.go:139
↓ 31 callers
Method
deps
()
cmd/pad/item_copy_test.go:110
↓ 31 callers
Function
getDashboard
helper: fetch the dashboard and return the parsed response
internal/server/handlers_dashboard_test.go:25
↓ 30 callers
Function
ItemRef
ItemRef returns the reference string (e.g. "TASK-5") for an item, or empty string.
internal/cli/format.go:95
↓ 30 callers
Method
Set
Set adds or replaces the credential for the given server URL. The canonical URL is mirrored into the value's ServerURL field so a caller reading the c
internal/cli/credentials.go:185
↓ 30 callers
Method
Write
(p []byte)
internal/server/token_reaper_test.go:21
↓ 30 callers
Function
isCollectionVisible
isCollectionVisible checks if a collection ID is in the visible set. If visibleIDs is nil, all collections are visible.
internal/server/server.go:2331
↓ 30 callers
Function
parseTimePtr
(s *string)
internal/store/store.go:868
↓ 30 callers
Function
readCSRFFromCookie
readCSRFFromCookie hits any consent-rendering endpoint that sets the CSRF cookie on first visit, returns the token. We use oauth/authorize because it'
internal/server/handlers_oauth_test.go:2421
↓ 29 callers
Function
imageRef
(id string)
internal/store/attachments_copy_plan_test.go:105
↓ 29 callers
Function
liveCmdhelpDoc
liveCmdhelpDoc returns a minimal cmdhelp.Document with every command path the read-only catalog references. Lighter than re-running pad's full cobra e
internal/mcp/catalog_readonly_test.go:430
↓ 29 callers
Function
mustUser
(t *testing.T, srv *Server, email, username, role string)
internal/server/authz_cross_workspace_test.go:76
↓ 29 callers
Function
newRestrictedOwnerVisibilityFixture
(t *testing.T)
internal/server/handlers_grant_visibility_test.go:33
↓ 29 callers
Function
refOf
refOf builds a PREFIX-NUMBER string from a fresh item — used by the integration tests since the canonical ref isn't on the model directly. ItemNumber
internal/store/wiki_links_test.go:543
↓ 29 callers
Function
root
()
web/src/lib/components/common/Lightbox.svelte.test.ts:179
↓ 28 callers
Method
GetWorkspaceMember
GetWorkspaceMember retrieves a single membership record.
internal/store/workspace_members.go:82
↓ 28 callers
Function
browserLogin
(page: Page)
web/e2e/lib/collab-helpers.ts:18
↓ 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
↓ 27 callers
Method
CreateItemLink
--- Item Links ---
internal/store/items.go:2870
↓ 27 callers
Method
SetParentLink
--- Phase Links --- SetParentLink sets the parent for an item. Since an item can belong to at most one parent, this deletes any existing parent link f
internal/store/items.go:3176
↓ 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
↓ 26 callers
Method
GetAttachment
GetAttachment returns the attachment with the given id, or (nil, nil) if no such row exists. Soft-deleted rows ARE returned (so download handlers can
internal/store/attachments.go:216
↓ 26 callers
Function
New
New creates a new Metrics instance with a custom registry and registers all application metrics plus Go runtime and process collectors.
internal/metrics/metrics.go:60
↓ 26 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
↓ 26 callers
Function
dialWS
(t *testing.T, server *httptest.Server, itemID string)
internal/collab/manager_test.go:296
↓ 26 callers
Method
resolvableBody
resolvableBody is a request the copy can actually satisfy: the two needs_value entries the base fixture leaves open are supplied, so the preflight com
internal/server/handlers_items_copy_test.go:111
↓ 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
Function
New
New creates a new in-memory EventBus with default replay buffer settings.
internal/events/bus.go:251
↓ 25 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
↓ 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
↓ 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:69
↓ 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
New
New creates a Store backed by SQLite at the given path. The DSN is configured for safe concurrent use under Go's connection pool: - `_pragma=busy_ti
internal/store/store.go:141
↓ 24 callers
Function
WithCurrentUser
Exported context-key helpers for callers that need to synthesize an authenticated request without going through the auth middleware chain (e.g. the in
internal/server/context.go:25
↓ 24 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:250
↓ 24 callers
Method
addEventListener
(type: 'toolchange', listener: (ev: Event) => void)
web/src/lib/webmcp/types.d.ts:78
↓ 24 callers
Function
assertDenied
(t *testing.T, got CrossWorkspaceAccess, want CrossWorkspaceDenialReason, label string)
internal/server/authz_cross_workspace_test.go:176
↓ 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:2379
↓ 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
↓ 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
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:48
↓ 23 callers
Function
mount
()
web/src/lib/components/graph/ItemGraph.svelte.test.ts:151
↓ 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
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:728
↓ 22 callers
Method
member
(email, username, wsRole string, ws *models.Workspace)
internal/server/authz_cross_workspace_test.go:123
↓ 22 callers
Function
mustSchemaCollection
(t *testing.T, srv *Server, wsID, name, schema string)
internal/server/handlers_items_copy_preflight_test.go:113
↓ 22 callers
Function
seedDoc
( fixture: SuiteFixture, request: APIRequestContext, titlePrefix = 'Collab persistence', fields: Record<st
web/e2e/lib/collab-helpers.ts:47
↓ 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
Function
BuildCLIArgs
BuildCLIArgs translates an MCP tool call's JSON arguments into the CLI argument list that should be appended after the command path. Pure function — n
internal/mcp/dispatch.go:362
↓ 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
Method
GetCollection
(id string)
internal/store/collections.go:169
↓ 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:1032
↓ 21 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:228
↓ 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
Function
loginUser
(t *testing.T, srv *Server, email, password string)
internal/server/handlers_rbac_test.go:92
↓ 21 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:2438
↓ 20 callers
Method
BaseURL
BaseURL returns the configured base URL.
internal/email/sender.go:94
↓ 20 callers
Method
Close
Close shuts the bus down, closing every subscriber channel.
internal/watchevents/watchevents.go:128
↓ 20 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:416
↓ 20 callers
Method
CreateOAuthClient
============================================================ Clients (RFC 7591 — Dynamic Client Registration) ========================================
internal/store/oauth.go:79
↓ 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
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:506
↓ 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:333
↓ 20 callers
Function
newCopyFixture
(t *testing.T)
internal/store/items_cross_workspace_copy_test.go:33
↓ 20 callers
Method
post
(path string, body interface{}, result interface{})
internal/cli/client.go:1581
↓ 20 callers
Method
req
()
internal/store/items_cross_workspace_copy_test.go:46
↓ 20 callers
Function
testServerWithEvents
(t *testing.T)
internal/server/handlers_events_test.go:20
↓ 20 callers
Function
workspaceIDForSlug
workspaceIDForSlug looks up the internal UUID for a slug — used by tests that synthesize attachment rows directly via the store (bypassing the upload
internal/server/handlers_storage_test.go:425
↓ 19 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
↓ 19 callers
Function
LoadStore
LoadStore reads the credentials file and returns a usable CredentialStore. Returns an empty (but non-nil) store if the file doesn't exist — that's not
internal/cli/credentials.go:96
↓ 19 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.
internal/store/items.go:686
↓ 19 callers
Method
ResolveItemIncludeDeleted
ResolveItemIncludeDeleted is like ResolveItem but includes soft-deleted items.
internal/store/items.go:729
↓ 19 callers
Method
ServeHTTP
(w http.ResponseWriter, r *http.Request)
internal/mcp/dispatch_http_test.go:44
↓ 19 callers
Method
UserCount
UserCount returns the total number of registered users.
internal/store/users.go:573
↓ 19 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
↓ 19 callers
Function
equalSlice
equalSlice is a small helper for stable []string comparison; kept here so test files across the package can share it. catalog_test.go has equalString
internal/mcp/registry_test.go:188
↓ 19 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
↓ 19 callers
Function
validationFailedResult
───────────────────────────────────────────────────────────────────── Helpers for non-HTTP error paths (TASK-1077 — replace plain-string NewToolResult
internal/mcp/errors.go:1230
← previous
next →
101–200 of 7,856, ranked by callers