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
↓ 6 callers
Function
doLoopbackRequest
(srv *Server, method, path string, body interface{})
internal/server/server_test.go:44
↓ 6 callers
Function
escapeTableCell
escapeTableCell escapes characters that would break a markdown table row: `|` becomes `\|`, and existing backslashes are doubled so the escape stays v
internal/urlimport/openapi.go:505
↓ 6 callers
Function
extractCommandBlock
extractCommandBlock returns the substring of `md` covering one command's section, identified by its full path (e.g. "item create"). Used to scope asse
internal/cmdhelp/md_test.go:356
↓ 6 callers
Function
extractFieldValue
extractFieldValue pulls a named string field out of an item's fields JSON blob. Returns "" when the blob is empty, unparseable, or carries no string v
internal/store/status_transitions_backfill.go:17
↓ 6 callers
Function
fakeUser
===================================================================== Helpers ===================================================================== fa
internal/mcp/dispatch_http_envelope_test.go:449
↓ 6 callers
Function
fileExists
(dir, name string)
internal/cli/detect.go:203
↓ 6 callers
Function
flexJSONToString
flexJSONToString accepts a raw JSON value and returns it as a canonical JSON-encoded string. Acceptable inbound shapes: - absent / empty / null → nil
internal/models/item.go:755
↓ 6 callers
Function
getConfiguredConfig
()
cmd/pad/configure.go:68
↓ 6 callers
Method
getWorkspaceDocument
isUUID is defined in handlers_items.go getWorkspaceDocument resolves workspace slug and document ID from URL params.
internal/server/server.go:2420
↓ 6 callers
Method
hasBootstrapToken
hasBootstrapToken reports whether a bootstrap token is currently configured. Lock-aware — safe to call without holding s.bootstrapMu. Used by handleSe
internal/server/bootstrap.go:156
↓ 6 callers
Method
invalidate
invalidate clears the cached entry for a workspace. Call after any mutation that changes used_bytes (uploads, deletes, transforms) so the next GET see
internal/server/handlers_storage.go:93
↓ 6 callers
Function
isAPITokenAuth
isAPITokenAuth returns true if the request was authenticated via an API token (not a session cookie or CLI session). Use this to gate sensitive operat
internal/server/middleware_auth.go:452
↓ 6 callers
Function
listTransitions
listTransitions returns all status_transitions rows for an item, oldest first.
internal/store/status_transitions_test.go:12
↓ 6 callers
Method
markUploadInFlight
markUploadInFlight increments the in-flight counter for a content hash. Returns a release func the caller MUST defer; the release decrements and remov
internal/server/server.go:750
↓ 6 callers
Function
membersHandler
membersHandler returns an http.Handler that responds to any path with the standard `{members:[...], invitations:[]}` shape using the supplied rows.
internal/mcp/dispatch_http_advanced_test.go:877
↓ 6 callers
Function
mustSeedWorkspaceForMutation
(t *testing.T, srv *Server, ownerID, slug, role string)
internal/server/handlers_connected_apps_mutations_test.go:86
↓ 6 callers
Function
newClaimCodeEnv
(t *testing.T)
internal/server/handlers_claim_code_test.go:86
↓ 6 callers
Function
newConnectedTestStore
Connected-apps store tests (PLAN-943 TASK-954). What's covered: - ListUserOAuthConnections deduplicates a chain across multiple access-token rows (r
internal/store/connected_apps_test.go:29
↓ 6 callers
Function
newTestConfig
(t *testing.T)
internal/config/encryption_key_test.go:12
↓ 6 callers
Function
normalizeStringEncodedJSONFields
normalizeStringEncodedJSONFields recursively walks a parsed JSON value, finds string-typed `fields` and `tags` properties, parses them as embedded JSO
internal/mcp/dispatch.go:209
↓ 6 callers
Function
packageHTTPResponse
packageHTTPResponse turns the recorded handler response into an MCP CallToolResult, mirroring ExecDispatcher's "JSON → structured + text fallback" beh
internal/mcp/dispatch_http.go:664
↓ 6 callers
Function
parseAttachmentFilename
parseAttachmentFilename extracts the filename from a Content-Disposition header. Mirrors the CLI's helper of the same name (cmd/pad/main.go parseAttac
internal/mcp/dispatch_http_attachments.go:190
↓ 6 callers
Function
parsePadURI
parsePadURI extracts (workspace, kind, arg) from a pad:// URI. arg is empty for list-style resources (no trailing segment). Forms accepted: pad://w
internal/mcp/resources.go:426
↓ 6 callers
Function
playbooksCollection
playbooksCollection returns a Playbooks collection scoped to the caller's domain. Like conventionsCollection, the trigger and scope select options are
internal/collections/templates.go:360
↓ 6 callers
Function
recordInstallation
recordInstallation stores a skill install in the global registry (~/.pad/installations.json).
cmd/pad/cmd_agent.go:203
↓ 6 callers
Function
renderItemTable
renderItemTable is the testable core of PrintItemTable: it lays the item list out into maxWidth columns and writes to w. Columns are REF/TITLE · STATU
internal/cli/format.go:221
↓ 6 callers
Function
requesterToOAuthRequest
===================================================================== Translation helpers ============================================================
internal/oauth/storage.go:444
↓ 6 callers
Method
runWorkspacePurgeSweep
runWorkspacePurgeSweep purges every workspace whose deleted_at is older than cutoff. Blobs are reclaimed BEFORE the DB rows are removed so a failed re
internal/server/workspace_purge.go:215
↓ 6 callers
Function
sanitizeFTSQuery
sanitizeFTSQuery wraps each token in double quotes so FTS5 treats special characters (like hyphens) as literals rather than operators. Only used for S
internal/store/search.go:764
↓ 6 callers
Function
sanitizePGFTSQuery
sanitizePGFTSQuery returns a copy of q with hyphens replaced by spaces. Used as the second leg of the OR-combined PG FTS query: postgres' english pars
internal/store/search.go:790
↓ 6 callers
Function
seedBackfillWorkspace
(t *testing.T, s *Store, name, ownerID string)
internal/store/oauth_connections_backfill_test.go:52
↓ 6 callers
Function
seedCollabFixture
seedCollabFixture creates the minimum fixture chain needed to test the collab WS endpoint: workspace + collection + item, all in the store, returning
internal/server/handlers_collab_test.go:61
↓ 6 callers
Function
seedUser
seedUser creates a user that subsequent oauth tokens can use as their `subject`.
internal/store/connected_apps_test.go:61
↓ 6 callers
Method
startMCPSessionTracker
startMCPSessionTracker constructs the tracker + spawns the sweep goroutine. Called once at startup from SetMCPTransport (alongside startMCPAuditWriter
internal/server/middleware_mcp_session.go:225
↓ 6 callers
Method
trackMCPSession
(reqHeader, respHeader func(string) string, method string, httpStatus int)
internal/server/middleware_mcp_session.go:274
↓ 6 callers
Method
validateSessionCookie
validateSessionCookie validates a session cookie and returns the user if valid, nil otherwise. A User-Agent change is logged but NOT rejected — this m
internal/server/handlers_auth.go:259
↓ 6 callers
Function
veErrorCode
veErrorCode extracts the JSON error.code from a response, or "" if the body isn't an error envelope.
internal/server/middleware_verified_email_test.go:143
↓ 6 callers
Function
writeBootstrapToken
writeBootstrapToken drops a token file at <dataDir>/.bootstrap-token in the same shape EnsureBootstrapToken would produce — token + trailing newline,
internal/cli/bootstrap_test.go:52
↓ 5 callers
Method
AcquireParentChildrenLocks
AcquireParentChildrenLocks is the CANONICAL helper for taking `pad:parent-children:<id>` advisory locks. Every call site that needs to serialize again
internal/store/items.go:3741
↓ 5 callers
Method
Addr
Addr returns the host:port listen address.
internal/config/config.go:342
↓ 5 callers
Function
ApplyWorkspaceContext
(raw string, context *WorkspaceContext)
internal/models/workspace_settings.go:99
↓ 5 callers
Method
AsPlanLimit
AsPlanLimit returns the parsed plan-limit details when this APIError carries them, or nil otherwise. Returns nil for any error other than "plan_limit_
internal/cli/client.go:1235
↓ 5 callers
Method
BaseURL
BaseURL returns the base URL for the API. If URL is set (via config, --url flag, or PAD_URL), it takes precedence. Otherwise, constructs from host and
internal/config/config.go:355
↓ 5 callers
Method
CancelCustomer
CancelCustomer asks pad-cloud to cancel every active Stripe subscription for customerID and then delete the Stripe customer object. Used by handleDele
internal/server/server.go:454
↓ 5 callers
Function
CapabilityLine
CapabilityLine returns the single-line capability bit a conforming CLI emits in response to `<cmd> help --capabilities` (or the `--cmdhelp-capabilitie
internal/cmdhelp/json.go:27
↓ 5 callers
Method
Clone
Clone overrides DefaultSession.Clone so the returned value is a *Session, not a *DefaultSession. Without this override, fosite's internal Clone() call
internal/oauth/session.go:163
↓ 5 callers
Method
ConsumeEmailVerification
ConsumeEmailVerification atomically validates and marks a verification token as used, then sets users.email_verified_at to now. Returns the (now-verif
internal/store/email_verification.go:93
↓ 5 callers
Method
ConsumeTOTPStep
ConsumeTOTPStep atomically records a TOTP time-step as consumed, enforcing single-use semantics for login codes (BUG-2054). It succeeds only if step i
internal/store/users.go:1263
↓ 5 callers
Method
CreatePasswordReset
CreatePasswordReset generates a reset token for the given user. Returns the plaintext token (to embed in the reset URL). The token is stored as a SHA-
internal/store/password_resets.go:19
↓ 5 callers
Method
CreateWebhook
CreateWebhook registers a new webhook for a workspace.
internal/store/webhooks.go:11
↓ 5 callers
Method
Crop
Crop returns the rectangular sub-image bounded by `rect`. The rectangle is interpreted in the image's coordinate space (origin top-left) and intersect
internal/attachments/processor.go:55
↓ 5 callers
Function
Detect
Detect classifies a fetched document by inspecting its Content-Type header and the leading bytes of its body. It returns TypeOpenAPI when the document
internal/urlimport/detect.go:33
↓ 5 callers
Method
Error
()
internal/server/handlers_items_bulk.go:84
↓ 5 callers
Method
Error
()
internal/billing/cloud_client.go:102
↓ 5 callers
Method
FTSMatch
FTSMatch returns the full-text search WHERE clause fragment. SQLite: "table MATCH ?" — consumes ONE arg. PostgreSQL: an OR-combined plainto_tsquery ma
internal/store/dialect.go:86
↓ 5 callers
Method
GetAgentRole
(workspaceID, idOrSlug string)
internal/store/agent_roles.go:39
↓ 5 callers
Method
GetAttachmentVariant
GetAttachmentVariant returns the derived attachment row for parentID with the given variant key (e.g. "thumb-sm"), or (nil, nil) if no such row exists
internal/store/attachments.go:117
↓ 5 callers
Method
GetAuthorizationCode
GetAuthorizationCode hydrates the code's session. Returns ErrOAuthInvalidatedCode if the row exists but active=false (fosite triggers grant-family rev
internal/store/oauth.go:269
↓ 5 callers
Method
GetChildItems
GetChildItems returns all non-deleted child items linked to the given parent via item_links. Returns children from any collection.
internal/store/items.go:3524
↓ 5 callers
Method
GetDashboard
--- Dashboard --- GetDashboard returns the workspace dashboard as raw JSON. The DashboardResponse type lives in the server package, so we use json.Raw
internal/cli/client.go:398
↓ 5 callers
Method
GetItemContentFlushedOpLogID
GetItemContentFlushedOpLogID returns the per-item flush watermark (TASK-1309). Returns (0, false) for items with NULL watermark or no row.
internal/collab/room.go:148
↓ 5 callers
Method
GetItemProgress
--- Child Item Progress --- GetItemProgress counts total and done child items linked to a parent via item_links. "Done" means the child item's done fi
internal/store/items.go:3245
↓ 5 callers
Method
GetOAuthProviders
GetOAuthProviders parses the JSON oauth_providers field into a string slice.
internal/models/user.go:47
↓ 5 callers
Method
GetShareLink
GetShareLink retrieves a share link by ID.
internal/store/share_links.go:98
↓ 5 callers
Method
GetWebhook
GetWebhook retrieves a single webhook by ID.
internal/store/webhooks.go:40
↓ 5 callers
Method
GetWorkspace
(slug string)
internal/cli/client.go:113
↓ 5 callers
Method
GuestVisibleResources
GuestVisibleResources returns the two-level visibility for a guest: - fullCollectionIDs: collections where the user has a direct collection grant (ful
internal/store/grants.go:492
↓ 5 callers
Method
ImportWorkspace
ImportWorkspace imports a workspace from an exported data structure. It creates a new workspace with regenerated IDs, remapping all references. If new
internal/store/export.go:210
↓ 5 callers
Function
IsTerminalItem
IsTerminalItem reports whether an item's fields map indicates the item is in a terminal state for its collection. This is the canonical Go-side "is do
internal/models/terminal.go:120
↓ 5 callers
Function
IsTerminalStatusDefault
IsTerminalStatusDefault checks using the default fallback list (for cases where no collection schema is available).
internal/models/terminal.go:180
↓ 5 callers
Method
ListCollections
--- Collections ---
internal/cli/client.go:172
↓ 5 callers
Method
ListCommentsBeforeTime
ListCommentsBeforeTime returns comments for an item created before the given time, ordered newest-first, limited to `limit` results. Used for cursor-b
internal/store/comments.go:132
↓ 5 callers
Method
ListStarredItems
ListStarredItems returns all items starred by a user in a workspace, enriched with collection and assignment info. Only non-deleted items are returned
internal/store/item_stars.go:96
↓ 5 callers
Method
ListSystemCollectionIDs
ListSystemCollectionIDs returns the IDs of system collections in a workspace. System collections are always visible to members regardless of collectio
internal/store/workspace_members.go:333
↓ 5 callers
Function
ListTemplates
ListTemplates returns all workspace templates that should be shown in pickers. Templates flagged Hidden are excluded.
internal/collections/templates.go:918
↓ 5 callers
Function
New
(s *store.Store)
internal/server/server.go:345
↓ 5 callers
Function
NewCloudClient
NewCloudClient constructs a client pointed at the given pad-cloud base URL (e.g. "http://pad-cloud:7778") authenticated with cloudSecret. Both values
internal/billing/cloud_client.go:76
↓ 5 callers
Function
NewFSStore
NewFSStore returns a store rooted at baseDir, creating the directory if it does not exist. baseDir is typically <DataDir>/attachments.
internal/attachments/fs_store.go:42
↓ 5 callers
Function
NewServer
NewServer constructs a pad MCP server. Call Run(ctx) to start it. The returned Server is wired with tool capabilities advertised but no tools registe
internal/mcp/server.go:45
↓ 5 callers
Function
NormalizeWorkspaceSettings
(raw string)
internal/models/workspace_settings.go:82
↓ 5 callers
Method
PIDFile
()
internal/config/config.go:415
↓ 5 callers
Function
PriorityColor
PriorityColor returns a *color.Color appropriate for the given priority string.
internal/cli/format.go:50
↓ 5 callers
Method
PruneYjsUpdatesBefore
(itemID string, before time.Time)
internal/collab/room.go:144
↓ 5 callers
Function
RenderAttachmentChip
RenderAttachmentChip builds a Notion-style file-chip anchor for a non-image attachment. `target=_blank` + `rel=noopener noreferrer` matches the existi
internal/server/render/attachments.go:140
↓ 5 callers
Function
RenderAttachmentImage
RenderAttachmentImage builds an inline `<img>` element for an image attachment. Width/height attributes are emitted when both are known and positive s
internal/server/render/attachments.go:112
↓ 5 callers
Function
RenderAttachmentMissing
RenderAttachmentMissing builds a placeholder span for a missing/deleted attachment. Keeps the document layout intact and tells the user *why* there's
internal/server/render/attachments.go:169
↓ 5 callers
Method
RevokeRefreshTokenFamily
============================================================ Token revocation (handler/oauth2/revocation_storage.go) =================================
internal/store/oauth.go:428
↓ 5 callers
Method
RoomCount
RoomCount is a test/debug accessor. Production code shouldn't make decisions based on this — the count is racy with grace-timer expirations.
internal/collab/manager.go:644
↓ 5 callers
Method
SetAllowedWorkspaces
SetAllowedWorkspaces is the symmetric writer used by oauth/authorize/decide (TASK-952). Centralizing the key string here keeps producers + consumers i
internal/oauth/session.go:137
↓ 5 callers
Method
SetAuthToken
SetAuthToken sets the authorization token for API requests.
internal/cli/client.go:80
↓ 5 callers
Method
SetBootstrapToken
SetBootstrapToken wires the in-memory token + on-disk path into the Server. Called once at startup from cmd/pad/main.go after EnsureBootstrapToken suc
internal/server/bootstrap.go:145
↓ 5 callers
Method
SetUserStripeCustomerID
SetUserStripeCustomerID stores the Stripe customer ID for a user.
internal/store/limits.go:328
↓ 5 callers
Method
Status
Status checks each tracked installation and returns its current state. embeddedContent is the raw embedded skill bytes, used for freshness comparison.
internal/cli/registry.go:137
↓ 5 callers
Function
TokenAllowedWorkspacesFromContext
TokenAllowedWorkspacesFromContext returns the token's workspace allow-list, or nil if none was attached. Three return shapes matter to callers: - nil
internal/server/context.go:201
↓ 5 callers
Function
ToolInstalled
ToolInstalled checks if the skill file exists for the given tool.
internal/cli/agents.go:153
↓ 5 callers
Method
WorkspaceAttachments
WorkspaceAttachments lists original (non-derived) attachments in a workspace, with optional filtering + sorting + pagination. Returns the page rows an
internal/store/attachments.go:342
↓ 5 callers
Method
WorkspaceStorageInfo
WorkspaceStorageInfo returns the consolidated quota summary for a workspace (used + limit + plan + override flag) in a single call. Used by the storag
internal/store/attachments.go:947
↓ 5 callers
Function
WritePlanLimitError
WritePlanLimitError formats a plan-limit rejection to w in the canonical two-track shape (TASK-788): 1. A single `pad-structured-error/v1: {json}\n`
internal/cli/client.go:1256
↓ 5 callers
Function
actionItemLink
actionItemLink dispatches pad_item.action=link to the appropriate CLI cmdPath based on link_type. Renames the schema's uniform `ref` and `target` to t
internal/mcp/catalog_item.go:410
↓ 5 callers
Function
applyConfigureValues
(cfg *config.Config, values *configureValues)
cmd/pad/configure.go:127
← previous
next →
501–600 of 6,005, ranked by callers