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
↓ 2 callers
Method
validateFTSInvariants
validateFTSInvariants checks that every trigger in expectedFTSTriggers exists. Missing triggers are logged as structured warnings; this function is in
internal/store/store.go:388
↓ 2 callers
Function
validateFieldType
(def models.FieldDef, val any)
internal/items/validate.go:120
↓ 2 callers
Function
validateNoReservedFieldKeys
validateNoReservedFieldKeys rejects a schema that newly introduces a field keyed "parent" or "plan". prevSchema is nil on collection create (nothing t
internal/server/handlers_collections.go:38
↓ 2 callers
Function
validateShareLinkOpts
validateShareLinkOpts checks that share link creation constraints are sane. Returns an error message string (empty if valid).
internal/server/handlers_share_links.go:53
↓ 2 callers
Function
validationFailedFromBuildErr
validationFailedFromBuildErr wraps a BuildCLIArgs error (typically "missing required argument %q" or "flag %q: <type-mismatch>") as a structured valid
internal/mcp/errors.go:586
↓ 2 callers
Function
veCollabMember
--------------------------------------------------------------------- Perimeter 4: collab WebSocket GET-upgrade (persists Yjs edits). ----------------
internal/server/middleware_verified_email_test.go:342
↓ 2 callers
Function
veOAuthUnverifiedSession
--------------------------------------------------------------------- Perimeter 5: OAuth-provider authorize + decide (mints auth codes). -------------
internal/server/middleware_verified_email_test.go:433
↓ 2 callers
Function
waitForAuditRows
waitForAuditRows polls ListMCPAuditByUser until we see the expected count or the deadline expires. The middleware writes async via a buffered channel
internal/server/middleware_mcp_audit_test.go:69
↓ 2 callers
Function
walk
(cur, root *cobra.Command, doc *Document, depth, maxDepth int)
internal/cmdhelp/json.go:111
↓ 2 callers
Method
wireOAuthMetricsObserver
wireOAuthMetricsObserver attaches the OAuth metrics that need both the metrics registry AND the OAuth server: the active-tokens callback collector (re
internal/server/server.go:828
↓ 2 callers
Function
workspaceHintLine
workspaceHintLine returns a concise comma-joined slug list, or an empty string when no hints were resolved (avoids "Available workspaces: " trailing n
internal/mcp/errors.go:281
↓ 2 callers
Function
writeFlagsTable
writeFlagsTable renders a flag map as a markdown table with sorted keys. Repeatable flags are marked in the type column for visibility.
internal/cmdhelp/md.go:219
↓ 2 callers
Function
writeJSONConfig
(path string, cfg map[string]any)
internal/mcp/install.go:353
↓ 2 callers
Method
writeMessage
writeMessage is a tiny helper that holds writeMu while writing one frame. All writes (replay during addConn, writeLoop fan-out) go through here so we
internal/collab/room.go:87
↓ 2 callers
Function
writeOpenChildrenError
writeOpenChildrenError emits the 409 response with both a human message AND the structured details payload. `parentRef` is the already-formatted paren
internal/server/handlers_items_open_children_guard.go:276
↓ 2 callers
Function
writePlanLimitError
writePlanLimitError writes a structured 403 response for plan limit violations. The envelope follows the standard {"error":{"code":...,"message":...,"
internal/server/handlers_cloud.go:1143
↓ 2 callers
Function
writeTOMLConfig
(path string, cfg map[string]any)
internal/mcp/install.go:522
↓ 1 callers
Method
ApproveCLIAuthSession
ApproveCLIAuthSession marks a pending session as approved, storing the session token and user ID. Returns an error if the session doesn't exist, is ex
internal/store/cli_auth_sessions.go:119
↓ 1 callers
Method
AreItemsStarred
AreItemsStarred returns a set of item IDs that are starred by the given user. Pass the item IDs you want to check; the returned map contains only the
internal/store/item_stars.go:57
↓ 1 callers
Method
AsUpdateConflict
AsUpdateConflict returns the parsed conflict details when this APIError carries them, or nil otherwise. Returns nil for any error other than "update_c
internal/cli/client.go:1186
↓ 1 callers
Method
AttachmentReferenced
AttachmentReferenced returns true when anything in the workspace mentions "pad-attachment:<id>" — either a live item's content/fields JSON or a commen
internal/store/attachments.go:638
↓ 1 callers
Method
BackfillEncryptTOTPSecrets
BackfillEncryptTOTPSecrets encrypts any plaintext TOTP secrets in the database. Idempotent: skips secrets that already have the "enc:" prefix. Called
internal/store/encryption.go:107
↓ 1 callers
Method
BackfillUserPlans
BackfillUserPlans sets the plan for all users that have an empty or default plan. In cloud mode, call with "free" to ensure all users have a plan set.
internal/store/limits.go:310
↓ 1 callers
Method
BuildAgentBootstrap
BuildAgentBootstrap assembles the bootstrap blob from store queries. This is the single canonical code path; the HTTP handler, the MCP resource handle
internal/server/handlers_bootstrap.go:423
↓ 1 callers
Function
BuildWorkspaceContext
BuildWorkspaceContext converts detected project metadata plus the current Pad client configuration into a machine-readable workspace context.
internal/cli/workspace_context_detect.go:15
↓ 1 callers
Method
CheckLimit
CheckLimit checks whether a workspace operation is allowed under the owner's plan. Resolution order: 1. User plan_overrides[feature] — per-user overri
internal/store/limits.go:63
↓ 1 callers
Method
ClaimWorkspace
ClaimWorkspace redeems a 6-digit claim code against the api/v1/oauth/claim endpoint, granting the calling OAuth connection access to the named workspa
internal/cli/client.go:164
↓ 1 callers
Method
CleanExpiredCLIAuthSessions
CleanExpiredCLIAuthSessions removes all expired CLI auth sessions.
internal/store/cli_auth_sessions.go:161
↓ 1 callers
Method
CleanExpiredPasswordResets
CleanExpiredPasswordResets removes old reset tokens.
internal/store/password_resets.go:110
↓ 1 callers
Function
CleanupStaleBootstrapToken
CleanupStaleBootstrapToken removes a token file left behind by a previous run that completed bootstrap but failed to delete the file. Called at startu
internal/server/bootstrap.go:132
↓ 1 callers
Method
Close
()
internal/store/store.go:258
↓ 1 callers
Method
CloseConn
CloseConn force-closes a single WebSocket connection registered with the manager, sending a close frame with a machine-readable reason first. Used by
internal/collab/manager.go:762
↓ 1 callers
Method
CollectionCheckboxProgress
CollectionCheckboxProgress returns the per-item checkbox totals for every item in a collection whose content has at least one `- [ ]` / `- [x]` marker
internal/store/items.go:1484
↓ 1 callers
Function
ComputeAdminUserStatusValue
ComputeAdminUserStatusValue is the exported wrapper around computeAdminUserStatus. Used by handlers that compute the status pill for a single-user res
internal/store/users.go:317
↓ 1 callers
Method
ConsumePasswordReset
ConsumePasswordReset atomically validates and marks a reset token as used. Returns the user if the token is valid, unused, and not expired. Returns ni
internal/store/password_resets.go:78
↓ 1 callers
Method
CountActiveOAuthAccessTokens
CountActiveOAuthAccessTokens returns the number of access-token rows with active=1. Backs the pad_oauth_active_tokens gauge (TASK-961). Caveat: the s
internal/store/oauth.go:450
↓ 1 callers
Method
CountAttachmentsForStorageKeyOutsideWorkspace
CountAttachmentsForStorageKeyOutsideWorkspace counts attachment rows in a DIFFERENT workspace that point at the same PHYSICAL blob (storage_key). Atta
internal/store/workspace_purge.go:134
↓ 1 callers
Method
CountProtectingAttachmentsForHash
CountProtectingAttachmentsForHash returns the number of rows pointing at the given content_hash whose presence requires the on-disk blob to stay. A ro
internal/store/attachments.go:601
↓ 1 callers
Method
CountStarredItems
CountStarredItems returns the number of starred items for a user in a workspace.
internal/store/item_stars.go:148
↓ 1 callers
Method
CreateAgentRole
CreateAgentRole creates a new agent role in a workspace.
internal/cli/client.go:666
↓ 1 callers
Method
CreateCLIAuthSession
CreateCLIAuthSession generates a new pending CLI auth session with a cryptographically random code and the default TTL. Returns the session including
internal/store/cli_auth_sessions.go:36
↓ 1 callers
Method
CreateCollection
(wsSlug string, input models.CollectionCreate)
internal/cli/client.go:177
↓ 1 callers
Method
CreatePKCERequestSession
===================================================================== PKCERequestStorage =============================================================
internal/oauth/storage.go:398
↓ 1 callers
Method
CreateWebhook
CreateWebhook registers a new webhook for a workspace.
internal/cli/client.go:629
↓ 1 callers
Function
DecomposePlaybook
DecomposePlaybook returns the library entry for the generic `decompose` playbook. Title is "Decompose a plan into tasks" to read well in the library c
internal/collections/playbook_library_decompose.go:157
↓ 1 callers
Function
DefaultTerminalStatusPlaceholders
DefaultTerminalStatusPlaceholders returns placeholders and args for the default terminal statuses list.
internal/models/terminal.go:201
↓ 1 callers
Method
Delete
Delete removes the credential for the given server URL. No-op if the entry isn't present, or if the receiver is nil.
internal/cli/credentials.go:199
↓ 1 callers
Method
DeleteAPIToken
DeleteAPIToken removes an API token by ID.
internal/store/api_tokens.go:191
↓ 1 callers
Method
DeleteAgentRole
(workspaceID, id string)
internal/store/agent_roles.go:147
↓ 1 callers
Method
DeleteAgentRole
DeleteAgentRole removes an agent role from a workspace.
internal/cli/client.go:684
↓ 1 callers
Method
DeleteCLIAuthSession
DeleteCLIAuthSession removes a CLI auth session by code.
internal/store/cli_auth_sessions.go:152
↓ 1 callers
Method
DeleteCollection
DeleteCollection soft-deletes a collection by setting collections.deleted_at. Items in the collection are NOT cascaded; they remain in the database wi
internal/cli/client.go:199
↓ 1 callers
Method
DeleteCollectionGrant
DeleteCollectionGrant revokes a collection grant by ID, scoped to a workspace.
internal/store/grants.go:86
↓ 1 callers
Method
DeleteComment
DeleteComment removes a comment by ID.
internal/store/comments.go:178
↓ 1 callers
Method
DeleteInvitation
DeleteInvitation removes a pending invitation.
internal/store/workspace_members.go:749
↓ 1 callers
Method
DeleteItem
(wsSlug, itemSlug string)
internal/cli/client.go:254
↓ 1 callers
Method
DeleteItemGrant
DeleteItemGrant revokes an item grant by ID, scoped to a workspace.
internal/store/grants.go:174
↓ 1 callers
Method
DeletePKCERequestSession
DeletePKCERequestSession removes the row after a successful /token exchange. fosite's PKCE lifecycle is delete-on-use, distinct from auth codes (which
internal/oauth/storage.go:424
↓ 1 callers
Method
DeleteRefreshToken
DeleteRefreshToken removes a refresh row entirely. Used by the rotation flow to drop the previous-step's refresh after the new one is in place.
internal/store/oauth.go:371
↓ 1 callers
Method
DeleteShareLink
DeleteShareLink deletes a share link by ID, scoped to a workspace.
internal/store/share_links.go:201
↓ 1 callers
Method
DeleteStarsForItem
DeleteStarsForItem removes all stars for a given item (used when deleting an item).
internal/store/item_stars.go:230
↓ 1 callers
Method
DeleteUser
DeleteUser permanently deletes a user by ID.
internal/store/users.go:937
↓ 1 callers
Method
DeleteView
DeleteView removes a view by ID.
internal/store/views.go:197
↓ 1 callers
Method
DeleteWebhook
DeleteWebhook removes a webhook by ID.
internal/store/webhooks.go:115
↓ 1 callers
Method
DeleteWebhook
DeleteWebhook removes a webhook by ID.
internal/cli/client.go:635
↓ 1 callers
Function
DetectProject
DetectProject analyzes the current directory to determine project type, build system, test runner, CI, and other metadata.
internal/cli/detect.go:30
↓ 1 callers
Function
DispatchInputFromContext
DispatchInputFromContext returns the original MCP tool-call JSON input attached by WithDispatchInput, or nil if none. Safe to call on any context.
internal/mcp/dispatch.go:65
↓ 1 callers
Method
Driver
()
internal/store/dialect.go:134
↓ 1 callers
Method
Driver
()
internal/store/dialect.go:212
↓ 1 callers
Method
EnableUser
EnableUser re-enables a disabled user account by clearing disabled_at.
internal/store/users.go:895
↓ 1 callers
Function
ErrManagerClosed
ErrManagerClosed exposes the manager's internal closed-flag error to callers via a public sentinel they can wrap. The internal errManagerClosed (in ma
internal/collab/applier.go:291
↓ 1 callers
Method
FTSMatch
(table, _ string)
internal/store/dialect.go:184
↓ 1 callers
Function
FieldsDSLToSchemaJSON
FieldsDSLToSchemaJSON parses the DSL and returns the marshaled CollectionSchema JSON string. Empty input returns "{}" — an empty schema. Convenience w
internal/collections/dsl.go:69
↓ 1 callers
Method
Generate
()
cmd/pad/cmd_server.go:1025
↓ 1 callers
Method
Get
Get returns the credential for the given server URL, or nil if none exists. URL is canonicalized (trailing slash + whitespace stripped) before lookup.
internal/cli/credentials.go:174
↓ 1 callers
Method
GetAgentBootstrap
--- Bootstrap --- GetAgentBootstrap returns the consolidated bootstrap blob — workspace + user + collections + always-on conventions + roles + playboo
internal/cli/client.go:430
↓ 1 callers
Method
GetAuditLog
--- Audit Log --- GetAuditLog fetches the global audit log (admin-only).
internal/cli/client.go:1030
↓ 1 callers
Method
GetChildItemsTx
GetChildItemsTx is the in-transaction variant of GetChildItems. The underlying query is the same as GetChildItems; using a *sql.Tx ties the read to th
internal/store/items.go:3550
↓ 1 callers
Method
GetCustomTemplate
(id string)
internal/store/templates.go:36
↓ 1 callers
Method
GetDeletedItemsWithCollection
GetDeletedItemsWithCollection returns minimal item info (ID + CollectionID) for soft-deleted items, used to filter deleted item IDs by collection visi
internal/store/items.go:4425
↓ 1 callers
Method
GetItemBySlugIncludeDeleted
GetItemBySlugIncludeDeleted finds an item by slug including soft-deleted items. Used for restore operations where the item is archived.
internal/store/items.go:766
↓ 1 callers
Method
GetItemLinkByID
GetItemLinkByID returns a single item link by its ID, or nil if not found.
internal/store/items.go:2754
↓ 1 callers
Method
GetItemVersionResolved
GetItemVersionResolved returns a single version with its diff resolved to full content. Reverse-patch versions can only be reconstructed by walking th
internal/store/items.go:4229
↓ 1 callers
Method
GetLibraryEntry
GetLibraryEntry fetches one library entry by exact title match. Conventions- first precedence — a title that resolves to a convention is returned as o
internal/cli/client.go:613
↓ 1 callers
Method
GetPKCERequestSession
GetPKCERequestSession hydrates the PKCE session. Returns fosite.ErrNotFound when missing (e.g. someone replayed an old auth code that's already been d
internal/oauth/storage.go:409
↓ 1 callers
Method
GetPlatformSettings
GetPlatformSettings returns all platform settings as a map.
internal/store/platform_settings.go:25
↓ 1 callers
Method
GetReport
GetReport returns the windowed project report JSON (PLAN-1628 / TASK-1630). window is one of day|week|2wk|month (empty = server default "week"); colle
internal/cli/client.go:406
↓ 1 callers
Method
GetRoleBoardItems
GetRoleBoardItems returns non-terminal items across all collections, grouped by role.
internal/store/agent_roles.go:289
↓ 1 callers
Method
GetShareLinkByToken
GetShareLinkByToken looks up a share link by its raw token (hashes it first).
internal/store/share_links.go:139
↓ 1 callers
Method
GetUserMemberWorkspaces
GetUserMemberWorkspaces returns only workspaces where the user has a workspace_members row — NO guest-grant fallback. Mirrors the first half of GetUse
internal/store/workspace_members.go:372
↓ 1 callers
Method
GetUserWorkspaces
GetUserWorkspaces returns all workspaces a user has access to, sorted by the user's custom sort order (then name as tiebreaker).
internal/store/workspace_members.go:410
↓ 1 callers
Method
GetVersion
(id string)
internal/store/versions.go:133
↓ 1 callers
Method
GetVersionResolved
GetVersionResolved returns a version with full content reconstructed. For diff-based versions, this requires walking the version chain.
internal/store/versions.go:155
↓ 1 callers
Method
GetWorkspacesBySlugForUser
GetWorkspacesBySlugForUser finds workspaces matching a slug that are accessible to the given user (owned, member, or guest with grants).
internal/store/workspaces.go:178
↓ 1 callers
Method
GroupConcat
GroupConcat returns SQL for string aggregation with a separator. SQLite: GROUP_CONCAT(DISTINCT expr) PostgreSQL: STRING_AGG(DISTINCT expr, ',')
internal/store/dialect.go:64
↓ 1 callers
Method
GroupConcat
(expr string, distinct bool)
internal/store/dialect.go:164
↓ 1 callers
Method
GroupConcat
(expr string, distinct bool)
internal/store/dialect.go:247
↓ 1 callers
Method
Handler
Handler returns the configured HTTP handler (router). Useful for testing with httptest.NewServer.
internal/server/server.go:1779
↓ 1 callers
Method
HardDeleteAttachment
HardDeleteAttachment removes the attachments row outright. Used by orphan GC after the grace period; never call from a request handler — soft-delete i
internal/store/attachments.go:579
↓ 1 callers
Method
HasActiveConnectionForUser
HasActiveConnectionForUser reports whether the user has ANY active OAuth connection at all, regardless of which workspaces it covers. The claim-code
internal/store/oauth_connections.go:527
← previous
next →
1,601–1,700 of 6,005, ranked by callers