Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PerpetualSoftware/pad
/ functions
Functions
6,005 in github.com/PerpetualSoftware/pad
⨍
Functions
6,005
◇
Types & classes
763
↓ 5 callers
Function
assertNotEmailBlocked
assertNotEmailBlocked asserts the response is NOT a verified-email 403 (it may legitimately be a 2xx, or a 4xx for an unrelated reason).
internal/server/middleware_verified_email_test.go:166
↓ 5 callers
Function
backdateItem
(t *testing.T, s *Store, itemID string, hoursAgo float64)
internal/store/reports_test.go:274
↓ 5 callers
Function
buildAllowSet
buildAllowSet returns nil for the "no token-level filter" cases (nil allow-list, or wildcard) and a slug-set otherwise. Matches the three return-shape
internal/mcp/dispatch_http_lister.go:125
↓ 5 callers
Function
classifyHTTPStatusKind
classifyHTTPStatusKind turns an HTTP error response into a structured envelope, using the dispatcher's known resource context to emit the right error
internal/mcp/errors.go:753
↓ 5 callers
Function
collectionAccessPath
This file pins BUG-1925: handleSetMemberCollectionAccess gated only on requireRole(r, "owner"), with zero validation of the CALLER's own visibility. A
internal/server/handlers_member_collection_access_escalation_test.go:20
↓ 5 callers
Method
createAuthSession
(w http.ResponseWriter, r *http.Request, user *models.User, ttl time.Duration)
internal/server/handlers_auth.go:331
↓ 5 callers
Function
createUnverifiedUser
createUnverifiedUser makes a user whose email starts UNVERIFIED, so a consume can be observed flipping it verified. CreateUser's safe default is verif
internal/store/email_verification_test.go:16
↓ 5 callers
Function
decodeBillingStats
(t *testing.T, rr *httptest.ResponseRecorder)
internal/server/handlers_admin_billing_test.go:101
↓ 5 callers
Function
decodeFields
decodeFields is a small test helper: parse an item's fields JSON into a map.
internal/store/items_fieldpatch_test.go:12
↓ 5 callers
Method
enrichItemForResponse
enrichItemForResponse populates derived closure and parent info on a single item. An optional visibleIDs slice filters related items so hidden-collect
internal/server/item_lineage.go:80
↓ 5 callers
Function
errStructured
errStructured wraps a Go error into the standard MCP tool-error envelope (TASK-1077) with a stable identifier prefix (e.g. "pad_item.link"). Local hel
internal/mcp/catalog_item.go:518
↓ 5 callers
Function
extractPRFromItem
(item *models.Item)
cmd/pad/cmd_github.go:390
↓ 5 callers
Function
fakeYjsRow
fakeYjsRow constructs a single row for the fakeOpLog seeding helpers. The store assigns ids in production; tests don't depend on them.
internal/collab/manager_test.go:1190
↓ 5 callers
Method
fetchAsResource
fetchAsResource is the shared shell-out + wrap path. padArgs is the leading argument list (without root flags); rootArgs are appended so --url etc. su
internal/mcp/resources.go:394
↓ 5 callers
Function
fixtureDoc
fixtureDoc returns a small cmdhelp.Document with the items the catalog tests need most often. Catalog actions only require their own cmdPath to be pre
internal/mcp/registry_test.go:51
↓ 5 callers
Function
formatItemAsMarkdown
formatItemAsMarkdown turns the JSON body returned by `pad item show --format json` into a self-contained markdown document: heading with ref + title,
internal/mcp/resources.go:264
↓ 5 callers
Function
fullVersion
()
cmd/pad/main.go:35
↓ 5 callers
Function
gaugeValueOrZero
gaugeValueOrZero pulls the gauge value or returns 0 when the underlying metric hasn't been touched yet.
internal/server/middleware_mcp_metrics_test.go:218
↓ 5 callers
Method
getLimiter
(key string)
internal/server/middleware_ratelimit.go:87
↓ 5 callers
Method
grantHiddenItemToOwner
grantHiddenItemToOwner gives the fixture's restricted owner an item-level grant on the hidden item, independent of their collection_access restriction
internal/server/handlers_grant_visibility_test.go:115
↓ 5 callers
Function
hideHandle
()
web/src/lib/components/editor/block-drag-handle.ts:402
↓ 5 callers
Function
hideMenu
()
web/src/lib/components/editor/block-drag-handle.ts:461
↓ 5 callers
Function
intPtr
(n int)
internal/cli/item_summary_test.go:11
↓ 5 callers
Function
isItemDone
isItemDone reports whether an item is in a terminal state for its collection's configured done field. Falls back to the default-terminal list against
internal/server/handlers_dashboard.go:245
↓ 5 callers
Function
isPublicAPIPath
isPublicAPIPath reports whether the given request path is an API endpoint that bypasses authentication entirely. These handlers must work even when th
internal/server/middleware_auth.go:333
↓ 5 callers
Function
itemOpenCmdWithOpener
(opener func(string) error)
cmd/pad/cmd_item.go:713
↓ 5 callers
Method
itemsPath
()
internal/server/middleware_verified_email_test.go:115
↓ 5 callers
Function
makeIntegrationPNG
makeIntegrationPNG returns a real PNG large enough that both thumb-sm (256px) and thumb-md (1024px) variants must scale down. Filled with a stripe pat
internal/server/handlers_attachments_thumbnails_test.go:25
↓ 5 callers
Function
maskAPIKey
maskAPIKey returns the display form of a sensitive setting value. Keys longer than 8 chars show their first and last 4 chars (abcd...wxyz); shorter no
internal/server/handlers_admin.go:93
↓ 5 callers
Function
mintOAuthTokenForTest
mintOAuthTokenForTest drives the consent → token exchange and returns the access token. Lightly customizable via the form arg so callers can vary the
internal/server/handlers_mcp_test.go:1634
↓ 5 callers
Function
mkAdminBearerReq
BUG-1616 extended coverage — admin-via-bearer gate at the SSE and WebSocket-collab entry points that sit OUTSIDE RequireWorkspaceAccess. These endpoin
internal/server/handlers_admin_bearer_gate_test.go:37
↓ 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
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:96
↓ 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
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
Method
publishItemEventWithName
publishItemEventWithName publishes a real-time event for item changes with actor name. `seq` is the item's workspace-scoped monotonic mutation cursor
internal/server/handlers_items.go:1792
↓ 5 callers
Function
readConfig
(t *testing.T, path string)
internal/mcp/install_test.go:819
↓ 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
Method
removeEventListener
(type: 'toolchange', listener: (ev: Event) => void)
web/src/lib/webmcp/types.d.ts:79
↓ 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
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
resolveWorkspace
resolveWorkspace resolves a workspace by slug or UUID, scoped to the authenticated user's accessible workspaces when a user context is present. Return
internal/server/server.go:2374
↓ 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:3645
↓ 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
scanAttachment
scanAttachment scans a single row into a models.Attachment, handling nullables via *string / *int.
internal/store/attachments.go:38
↓ 5 callers
Function
scanItems
(rows *sql.Rows)
internal/store/items.go:4315
↓ 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
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
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:526
↓ 5 callers
Function
testStorePostgres
testStorePostgres creates an isolated test database on the PostgreSQL server. It connects to the base URL, creates a randomly-named database, runs mig
internal/store/store_test.go:159
↓ 5 callers
Method
uniqueSlug
uniqueSlug generates a unique slug within a scope by appending -2, -3, etc.
internal/store/store.go:1114
↓ 5 callers
Method
waitForUpdate
()
internal/webhooks/dispatcher_test.go:55
↓ 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:114
↓ 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
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
D
D returns the store's dialect for building backend-specific SQL.
internal/store/store.go:72
↓ 4 callers
Method
DeleteItemLink
(id string)
internal/store/items.go:2772
↓ 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
Method
ExportWorkspace
ExportWorkspace exports all data for a workspace into a portable format.
internal/store/export.go:66
↓ 4 callers
Function
ExtractItemDecisionLog
(fieldsJSON string)
internal/models/item.go:342
↓ 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
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:3823
↓ 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
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
IsWorkspaceMember
IsWorkspaceMember checks if a user is a member of a workspace.
internal/store/workspace_members.go:593
↓ 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:153
↓ 4 callers
Method
ListItemVersions
ListItemVersions returns all versions for an item.
internal/store/items.go:4288
↓ 4 callers
Method
ListItemVersionsResolved
ListItemVersionsResolved returns versions with full content (diffs resolved). Requires the current item content to reconstruct diff-based versions.
internal/store/items.go:4197
↓ 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
ListWorkspaceActivity
(workspaceID string, params models.ActivityListParams)
internal/store/activities.go:359
↓ 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
LookupMIME
LookupMIME returns the entry for a MIME type if it is on the allowlist, or (zero, false) if rejected.
internal/attachments/mime.go:135
↓ 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
← previous
next →
601–700 of 6,005, ranked by callers