Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PerpetualSoftware/pad
/ functions
Functions
7,659 in github.com/PerpetualSoftware/pad
⨍
Functions
7,659
◇
Types & classes
942
↓ 5 callers
Function
needsValueByKey
(resp ItemCopyPreflight, key string)
internal/server/handlers_items_copy_preflight_test.go:249
↓ 5 callers
Function
newBearerGateItemFixture
(t *testing.T)
internal/server/handlers_items_test.go:2560
↓ 5 callers
Function
newCopyAttachmentFixture
(t *testing.T)
internal/server/handlers_items_copy_attachment_authz_test.go:56
↓ 5 callers
Function
newCopyFanoutObserver
(t *testing.T, f *copyPreflightFixture)
internal/server/handlers_items_copy_test.go:557
↓ 5 callers
Function
newDerivationFixture
(t *testing.T)
internal/server/handlers_attachments_thumbnails_parent_test.go:35
↓ 5 callers
Function
newRootCmd
newRootCmd constructs the pad CLI's root cobra command tree. Extracted from main() so tests can use the real tree (golden snapshots, schema validatio
cmd/pad/main.go:90
↓ 5 callers
Function
newWebhookTestWorkspace
newWebhookTestWorkspace creates a user + workspace so webhook FK constraints are satisfied, and returns the workspace ID.
internal/store/webhooks_test.go:16
↓ 5 callers
Function
normalizeCollectionSlug
normalizeCollectionSlug maps common singular/short forms to actual collection slugs. Thin wrapper around the shared collections.NormalizeSlug so the C
cmd/pad/cmd_collection.go:498
↓ 5 callers
Method
observeOAuthFlowDuration
observeOAuthFlowDuration records the elapsed time since `start` for the given stage. Designed to be `defer`'d at the top of each OAuth flow handler so
internal/server/handlers_oauth.go:135
↓ 5 callers
Function
open
* Open the workspace's IDB database for the given user, creating * object stores on first run. Cached so subsequent calls reuse the * connection. Re
web/src/lib/stores/localIndexPersistence.ts:98
↓ 5 callers
Function
paneFocusables
( container: HTMLElement, isVisible: (el: HTMLElement) => boolean = isFocusableVisible, )
web/src/lib/collections/paneFocus.ts:37
↓ 5 callers
Function
parseFieldKVP
parseFieldKVP normalizes the --field flag's various wire shapes (single string, []string, []any) into a `key→value` map. Empty / invalid entries are s
internal/mcp/dispatch_http.go:892
↓ 5 callers
Method
patch
(path string, body interface{}, result interface{})
internal/cli/client.go:1554
↓ 5 callers
Method
pathFor
pathFor returns the full on-disk path for a given hash. Callers MUST have already validated the hash via validHash — this function does not re-check,
internal/attachments/fs_store.go:61
↓ 5 callers
Function
percentile
percentile returns the linearly-interpolated p-quantile (p in [0,1]) of vals, rounded to 1 decimal. 0 for an empty sample. Computed in Go so the same
internal/store/reports.go:944
↓ 5 callers
Function
postOAuthLogin
postOAuthLogin fires a cloud-secret-authenticated oauth-login request and returns the recorder. The cloud secret rides the JSON body (the same channel
internal/server/handlers_oauth_provider_test.go:21
↓ 5 callers
Method
publishEventWithName
publishEventWithName publishes a real-time event with actor name.
internal/server/handlers_documents.go:223
↓ 5 callers
Function
readConfig
(t *testing.T, path string)
internal/mcp/install_test.go:819
↓ 5 callers
Function
reconcile
* Recompute and apply the desired inert set from scratch. This is the ONLY * mutator: release doesn't undo its own writes, it re-derives the truth fr
web/src/lib/a11y/viewerBackdrop.ts:96
↓ 5 callers
Method
recordMCPAuthzDenial
recordMCPAuthzDenial bumps the pad_mcp_authz_denials_total counter when the request originated from the MCP surface. The discriminator is the presence
internal/server/middleware_auth.go:734
↓ 5 callers
Function
remoteCfg
remoteCfg builds a Config wired to point at the given test server URL.
cmd/pad/init_test.go:37
↓ 5 callers
Function
remoteHeadlessCfg
remoteHeadlessCfg builds a Config wired to point at the given httptest server URL in Remote mode. Remote mode makes EnsureServer a no-op.
cmd/pad/setup_headless_test.go:78
↓ 5 callers
Function
renderItemsGroupedByCollectionMarkdown
renderItemsGroupedByCollectionMarkdown is the markdown counterpart of printItemsGroupedByCollection (#898): one `## Icon Name (N)` heading per collect
cmd/pad/cmd_item.go:457
↓ 5 callers
Method
requireCommentVisible
requireCommentVisible checks that a comment's underlying item is in a visible collection. Writes a 404 and returns false if not.
internal/server/handlers_comments.go:433
↓ 5 callers
Method
resolveAttachmentParentItem
resolveAttachmentParentItem loads and validates the parent item of an attachment row that has ALREADY been established as live and belonging to the re
internal/server/attachments_authz.go:73
↓ 5 callers
Method
resolveRoleSlug
resolveRoleSlug rewrites a `--role <slug>` input into `agent_role_id <uuid>` by hitting the agent-roles endpoint and finding a matching role. Mirrors
internal/mcp/dispatch_http_advanced.go:92
↓ 5 callers
Method
restore
(t *testing.T)
internal/server/handlers_items_collab_versions_test.go:625
↓ 5 callers
Function
retryOnParentSetChanged
retryOnParentSetChanged runs fn, retrying (up to maxParentLockRetries) while it returns errParentSetChanged. fn MUST open and own its own transaction
internal/store/items.go:3995
↓ 5 callers
Function
sampleConvention
()
internal/artifact/encode_test.go:38
↓ 5 callers
Function
scanActivitiesWithUser
(rows interface { Next() bool Scan(dest ...interface{}) error Err() error })
internal/store/activities.go:480
↓ 5 callers
Function
scanItems
(rows *sql.Rows)
internal/store/items.go:4675
↓ 5 callers
Function
scanUser
scanUser scans a user row into a User struct. Note: does NOT decrypt the TOTP secret — call store.decryptUserTOTP() after scanning if you need the pla
internal/store/users.go:35
↓ 5 callers
Function
seedAccess
seedAccess inserts an access-token row in the chain identified by requestID. ts is the requested_at timestamp; sessionData + scopes land on the row. R
internal/store/connected_apps_test.go:77
↓ 5 callers
Function
seedClient
seedClient creates an oauth_clients row so chains have something to FK against. Returns the client ID.
internal/store/connected_apps_test.go:42
↓ 5 callers
Function
seedGrantChain
seedGrantChain inserts one access-token row in a chain. Returns the request_id so tests can revoke / list / audit by it.
internal/server/handlers_connected_apps_test.go:71
↓ 5 callers
Function
seedWorkspaceForConn
seedWorkspaceForConn creates a workspace and returns its ID — the join table stores workspace IDs, so tests need a real row.
internal/store/oauth_connections_test.go:48
↓ 5 callers
Method
setSourceContent
setSourceContent rewrites the source item's body — the attacker's own legitimate edit of an item they hold, which is the whole vector.
internal/server/handlers_items_copy_attachment_authz_test.go:94
↓ 5 callers
Function
setupEnsureWorkspaceTest
setupEnsureWorkspaceTest produces a clean tempdir, points HOME at a tempdir (so credential/config writes don't leak), chdirs into the project so cli.D
cmd/pad/init_test.go:20
↓ 5 callers
Method
snapshot
()
internal/server/handlers_items_copy_preflight_test.go:846
↓ 5 callers
Function
softDeleteWorkspaceAt
softDeleteWorkspaceAt stamps a workspace's deleted_at to a specific time so the sweep's age cutoff can be exercised deterministically — there's no API
internal/server/workspace_purge_test.go:36
↓ 5 callers
Method
sseSubscriberStillHasAccess
sseSubscriberStillHasAccess re-runs the workspace access check for an already-subscribed SSE client. Returns false when the caller can no longer see t
internal/server/handlers_events.go:609
↓ 5 callers
Function
tokenScopeAllows
tokenScopeAllows checks if the token's scopes permit the given HTTP method and path. Scopes are stored as a JSON array of strings. Supported scopes (
internal/server/middleware_auth.go:1155
↓ 5 callers
Function
tp
A touch pointer event, dispatched on the IMAGE by default (the painted-image hit).
web/src/lib/components/common/Lightbox.svelte.test.ts:2711
↓ 5 callers
Function
variantRow
variantRow looks up a derived variant of parentID. GetAttachmentVariant is workspace-scoped (PLAN-2391 DR-16), so the scope is read back off the paren
internal/server/handlers_attachments_thumbnails_test.go:26
↓ 5 callers
Method
waitForUpdate
()
internal/webhooks/dispatcher_test.go:55
↓ 5 callers
Function
withAuthorizer
(req AttachmentCopyRequest, auth AttachmentAuthorizer)
internal/store/attachments_copy_plan_test.go:1087
↓ 5 callers
Function
withLocalFetcher
withLocalFetcher replaces the package-level fetcher with one that allows loopback dials so httptest.NewServer addresses (127.0.0.1) can be reached. Re
internal/server/handlers_import_test.go:17
↓ 4 callers
Method
CheckUserLimit
CheckUserLimit checks a user-level limit (not workspace-scoped), such as total workspace count or total API tokens.
internal/store/limits.go:139
↓ 4 callers
Function
Cleanup
Cleanup removes the process-wide template database, if one was built. Call it from TestMain after m.Run() so a lazily-built template file doesn't ling
internal/store/storetest/storetest.go:113
↓ 4 callers
Function
CopyCommitted
CopyCommitted reports whether err is a post-commit reporting failure — the copy happened, only its result was lost. Callers must not present these as
internal/cli/client_items_copy.go:305
↓ 4 callers
Method
CopyItemPreflight
CopyItemPreflight runs the DRY RUN. It mutates nothing in the copy's own domain, so it is safe to call repeatedly and safe to retry. Returns the deco
internal/cli/client_items_copy.go:251
↓ 4 callers
Method
CreateAuthorizationCode
============================================================ Authorization codes (handler/oauth2/storage.go AuthorizeCodeStorage) ====================
internal/store/oauth.go:261
↓ 4 callers
Function
CreatePatch
CreatePatch computes a compact patch that transforms oldText into newText. The patch can be applied with ApplyPatch to recover newText from oldText.
internal/diff/diff.go:16
↓ 4 callers
Function
CreateReversePatch
CreateReversePatch computes a patch that transforms newText back into oldText. Used for reverse-diff version storage: current doc has latest content,
internal/diff/diff.go:55
↓ 4 callers
Method
CreateView
CreateView adds a new saved view.
internal/store/views.go:11
↓ 4 callers
Method
EncryptWebhookSecretsAtRest
EncryptWebhookSecretsAtRest encrypts plaintext webhook HMAC secrets (BUG-2057). Called on startup when an encryption key is configured. It handles two
internal/store/encryption.go:165
↓ 4 callers
Function
ExtractItemDecisionLog
(fieldsJSON string)
internal/models/item.go:395
↓ 4 callers
Function
ExtractWorkspaceContext
(raw string)
internal/models/workspace_settings.go:118
↓ 4 callers
Method
FTSRank
FTSRank returns the column/expression for full-text relevance ranking. SQLite: rank (built-in FTS5 column) — consumes ZERO args. PostgreSQL: ts_rank b
internal/store/dialect.go:99
↓ 4 callers
Function
FindAgent
FindAgent returns the matching Agent for a name or alias. Names are case-insensitive (Claude / claude / CLAUDE all resolve).
internal/mcp/install.go:118
↓ 4 callers
Function
GenerateUsername
--- Username backfill --- GenerateUsername derives a URL-safe username from a display name. Falls back to the email local part if the name produces an
internal/store/users.go:1053
↓ 4 callers
Method
GetAgentRole
(workspaceID, idOrSlug string)
internal/store/agent_roles.go:39
↓ 4 callers
Method
GetChildItemsForParents
GetChildItemsForParents returns the live child items for each of the given parent item IDs, grouped by parent ID, in ONE query — collapsing the per-pa
internal/store/items.go:4173
↓ 4 callers
Method
GetCollectionAnyState
GetCollectionAnyState is GetCollection without the `deleted_at IS NULL` filter — used by the open-children guard (IDEA-1494 R3 P3) so a child still at
internal/store/collections.go:188
↓ 4 callers
Method
GetDeletedWorkspaceBySlug
GetDeletedWorkspaceBySlug returns a SOFT-DELETED workspace by slug (deleted_at IS NOT NULL), including its owner_id, or nil when no such row exists (l
internal/store/workspaces.go:307
↓ 4 callers
Method
GetInvitationByCode
GetInvitationByCode retrieves a pending invitation by its join code. Looks up by SHA-256 hash first (new invitations), then falls back to plaintext lo
internal/store/workspace_members.go:688
↓ 4 callers
Method
GetUserByUsername
GetUserByUsername retrieves a user by username (case-insensitive).
internal/store/users.go:146
↓ 4 callers
Method
GetView
GetView returns a single view by ID.
internal/store/views.go:47
↓ 4 callers
Method
GetWebhook
GetWebhook retrieves a single webhook by ID.
internal/store/webhooks.go:40
↓ 4 callers
Function
GroupTemplatesByCategory
GroupTemplatesByCategory returns the visible workspace templates grouped by category in the canonical CategoryOrder. Categories with no visible templa
internal/collections/templates.go:66
↓ 4 callers
Method
HasEncryptionKey
HasEncryptionKey reports whether an encryption key is configured.
internal/store/encryption.go:24
↓ 4 callers
Function
IsDiffSmaller
IsDiffSmaller returns true if storing a diff would be meaningfully smaller than storing the full content. Returns false for near-complete rewrites whe
internal/diff/diff.go:45
↓ 4 callers
Method
ListAgentRoles
(workspaceID string)
internal/store/agent_roles.go:63
↓ 4 callers
Method
ListAgentRoles
--- Agent Roles --- ListAgentRoles returns all agent roles for a workspace.
internal/cli/client.go:660
↓ 4 callers
Method
ListCollectionsMinimal
ListCollectionsMinimal returns collection rows populated with just the fields needed for done-detection context and slug lookups: ID, Slug, Schema, Se
internal/store/collections.go:218
↓ 4 callers
Method
ListItemsChangesSince
ListItemsChangesSince returns the skinny-projection of items that have mutated (create / update / soft-delete / restore) since the given seq cursor, i
internal/store/items.go:1412
↓ 4 callers
Method
ListVersions
(documentID string)
internal/store/versions.go:73
↓ 4 callers
Method
ListWebhooks
(workspaceID string)
internal/webhooks/dispatcher.go:61
↓ 4 callers
Method
ListWorkspaceMembers
--- Workspace Members --- ListWorkspaceMembers returns all members of a workspace.
internal/cli/client.go:647
↓ 4 callers
Method
LookupEmailVerification
LookupEmailVerification performs a read-only validation of a verification token and returns the associated user WITHOUT consuming the token. Mirrors L
internal/store/email_verification.go:62
↓ 4 callers
Function
MCPTokenIdentityFromContext
MCPTokenIdentityFromContext returns (kind, ref) attached by WithMCPTokenIdentity, or ("", "") if none was set. The audit middleware uses this to popul
internal/server/context.go:180
↓ 4 callers
Function
MetricsMiddleware
MetricsMiddleware returns a chi middleware that records Prometheus metrics for every HTTP request: count, duration, and response size. Path labels us
internal/server/middleware_metrics.go:19
↓ 4 callers
Function
NewInstrumentedBus
NewInstrumentedBus wraps an EventBus with Prometheus instrumentation.
internal/metrics/instrumented_bus.go:22
↓ 4 callers
Function
NewPostgres
NewPostgres creates a Store backed by PostgreSQL. The connStr should be a PostgreSQL connection string (e.g. "postgres://user:pass@host/db").
internal/store/store.go:232
↓ 4 callers
Function
NormalizeAudience
RFC 8707 ("Resource Indicators for OAuth 2.0") audience-binding hook for pad's authorization server (PLAN-943 TASK-951 sub-PR B). fosite has no nativ
internal/oauth/audience.go:72
↓ 4 callers
Method
Ping
Ping verifies the database connection is alive.
internal/store/store.go:270
↓ 4 callers
Method
PublicLinkBaseURL
PublicLinkBaseURL returns the URL the server should embed in emailed links (password reset, invites, share links, admin invitations). Resolution order
internal/config/config.go:386
↓ 4 callers
Method
PurgeWorkspaceData
PurgeWorkspaceData hard-deletes every child row of a soft-deleted workspace and the workspace row itself, in a single transaction. Blob bytes are NOT
internal/store/workspace_purge.go:230
↓ 4 callers
Function
RemovePadEntry
RemovePadEntry deletes mcpServers.pad while leaving other servers + top-level keys intact. Returns (true, nil) when an entry was removed, (false, nil)
internal/mcp/install.go:263
↓ 4 callers
Method
Resize
Resize returns a new image with the longer edge fitted to maxLong, preserving aspect ratio. Images already within maxLong are returned unchanged so ca
internal/attachments/processor.go:41
↓ 4 callers
Method
ResolveUserPermission
ResolveUserPermission resolves the effective permission for a user on a specific item, following the permission resolution order from DOC-406: 1. Owne
internal/store/grants.go:279
↓ 4 callers
Method
RevokeAccessToken
RevokeAccessToken mirrors RevokeRefreshToken for access tokens. fosite calls these in pairs when revoking a grant (the unified "revoke the whole famil
internal/oauth/storage.go:382
↓ 4 callers
Method
RevokeUserOAuthConnection
RevokeUserOAuthConnection invalidates every token in the OAuth grant chain identified by requestID, after verifying the chain belongs to userID. Impl
internal/store/connected_apps.go:297
↓ 4 callers
Method
RotateAPIToken
RotateAPIToken generates a new secret for an existing token, preserving all metadata (name, scopes, workspace, user, expiry). The old token is invalid
internal/store/api_tokens.go:87
↓ 4 callers
Method
SetImageProcessor
SetImageProcessor wires the image processor that the upload handler uses to derive thumbnail variants (TASK-878). Optional — without it uploads still
internal/server/server.go:760
↓ 4 callers
Method
SetOAuthServer
OAuth 2.1 authorization-server HTTP handlers (PLAN-943 TASK-951). Sub-PR C built the /register, /authorize, /authorize/decide and token endpoints + th
internal/server/handlers_oauth.go:79
↓ 4 callers
Method
SetRestoreBoundary
SetRestoreBoundary records a restore boundary for itemID, keeping the stored value monotonically non-decreasing (a later restore always has a higher o
internal/collab/manager.go:151
↓ 4 callers
Method
SetSSELimits
SetSSELimits configures global and per-workspace SSE connection limits. A value of 0 means unlimited.
internal/server/server.go:914
↓ 4 callers
Method
SetTokenReaperConfig
SetTokenReaperConfig overrides the default sweep interval (1h). Pass 0 to keep the package default. Must be called before StartTokenReaper; calling af
internal/server/token_reaper.go:31
↓ 4 callers
Method
SetToolSurfaceHandler
SetToolSurfaceHandler wires the MCP catalog→JSON serializer onto the server (PLAN-1888 / TASK-1891). Called once at startup by cmd/pad/main.go with mc
internal/server/handlers_mcp.go:103
← previous
next →
801–900 of 7,659, ranked by callers