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
↓ 3 callers
Method
unsubscribeSecret
unsubscribeSecret derives a stable HMAC key from the Maileroo API key. This avoids needing a separate secret config — if the API key changes, old unsu
internal/server/handlers_unsubscribe.go:17
↓ 3 callers
Function
validateAgainstSchema
validateAgainstSchema runs the compiled schema against the given JSON document and returns the validation error (nil on success).
internal/cmdhelp/schema_test.go:29
↓ 3 callers
Function
veDoBearer
veDoBearer issues a request authenticated with a Bearer PAT (which skips CSRF). Mirrors the CLI / connector path through TokenAuth.
internal/server/middleware_verified_email_test.go:121
↓ 3 callers
Function
waitMail
waitMail blocks for the next captured email or fails on timeout. Emails are sent from a goAsync goroutine, so the caller can't assume synchronous deli
internal/server/handlers_verify_email_test.go:66
↓ 3 callers
Function
withFastPolling
withFastPolling shrinks the helper's tick interval and timeout to millisecond scale for the duration of a test, then restores them. Required for asser
internal/cli/bootstrap_test.go:228
↓ 3 callers
Function
writeEmailNotVerified
writeEmailNotVerified is the single 403 writer shared by every verified-email enforcement point so the code/message stay identical across perimeters (
internal/server/middleware_verified_email.go:143
↓ 3 callers
Function
writeFileAtomic
writeFileAtomic writes data to a sibling temp file, fsyncs it, then atomically renames it onto path. Unlike os.WriteFile it never truncates an existin
cmd/pad/cmd_item.go:1321
↓ 3 callers
Method
writeMCPUnauthorized
writeMCPUnauthorized emits the spec-shaped 401 every MCP client expects: WWW-Authenticate with realm + resource_metadata, plus a small JSON body so cu
internal/server/middleware_mcp_auth.go:598
↓ 3 callers
Function
writeSSEEvent
writeSSEEvent writes a single SSE event to the response writer. If eventID > 0, an "id:" field is included for Last-Event-ID support. Returns nil for
internal/server/handlers_events.go:613
↓ 2 callers
Method
AcceptInvitation
AcceptInvitation marks an invitation as accepted.
internal/store/workspace_members.go:737
↓ 2 callers
Method
AddOAuthProvider
AddOAuthProvider adds a provider to the user's oauth_providers list. No-op if the provider is already linked.
internal/store/users.go:682
↓ 2 callers
Method
AddReaction
AddReaction adds an emoji reaction to a comment. Returns the created reaction, or the existing one if the same user+emoji already exists.
internal/store/reactions.go:11
↓ 2 callers
Function
ApplyItemConventionMetadata
(fieldsJSON string, metadata *ItemConventionMetadata)
internal/models/item.go:391
↓ 2 callers
Method
BackfillWikiLinks
BackfillWikiLinks scans every item with non-empty content and re-parses its body to populate `item_wiki_links`. Designed to be called from server star
internal/store/wiki_links_backfill.go:56
↓ 2 callers
Method
Bootstrap
(ctx context.Context, workspace string)
internal/mcp/workspace.go:22
↓ 2 callers
Function
BootstrapTokenPath
BootstrapTokenPath returns the on-disk path for the bootstrap token file.
internal/server/bootstrap.go:49
↓ 2 callers
Method
BootstrapWithToken
BootstrapWithToken is like Bootstrap but sends token as the X-Bootstrap-Token header when token is non-empty. This is required for self-host deploymen
internal/cli/client.go:953
↓ 2 callers
Function
BuildConventionItemFields
(status string, metadata *ItemConventionMetadata)
internal/models/item.go:424
↓ 2 callers
Function
CanonicalizeRef
CanonicalizeRef is the exported alias for canonicalizeRef so the store layer's same-workspace workspace_ref normalization (Codex round 4 P2 of TASK-15
internal/links/extract.go:671
↓ 2 callers
Function
CapturePeerAddr
CapturePeerAddr must be installed BEFORE TrustedProxyRealIP in the chain. It snapshots the real TCP peer RemoteAddr into the request context so authen
internal/server/middleware_realip.go:21
↓ 2 callers
Method
CleanExpiredEmailVerifications
CleanExpiredEmailVerifications removes expired or already-used verification tokens. Mirrors CleanExpiredPasswordResets; run by the periodic token reap
internal/store/email_verification.go:140
↓ 2 callers
Method
CleanExpiredSessions
CleanExpiredSessions removes all sessions past their expiry time.
internal/store/sessions.go:256
↓ 2 callers
Method
Configure
Configure updates the sender's settings at runtime (e.g. when an admin changes platform settings). Thread-safe.
internal/email/sender.go:48
↓ 2 callers
Method
ConnectionWorkspaceCount
ConnectionWorkspaceCount returns the raw row count from oauth_connection_workspaces for a given request_id — regardless of the parent connection's all
internal/store/oauth_connections.go:367
↓ 2 callers
Method
ConsumeRecoveryCode
ConsumeRecoveryCode validates and removes a single recovery code. Recovery codes are stored as SHA-256 hashes. The provided plaintext code is hashed b
internal/store/users.go:1317
↓ 2 callers
Function
ConventionLibrary
ConventionLibrary returns all pre-defined convention categories with their conventions.
internal/collections/convention_library.go:23
↓ 2 callers
Method
CountBillingAggregates
CountBillingAggregates returns the per-plan customer counts and the count of new "pro" signups since `since`. Implemented as two scalar SQL queries so
internal/store/users.go:607
↓ 2 callers
Method
CreateAgentRole
(workspaceID string, input models.AgentRoleCreate)
internal/store/agent_roles.go:12
↓ 2 callers
Method
CreateAuthorizeCodeSession
===================================================================== AuthorizeCodeStorage ===========================================================
internal/oauth/storage.go:180
↓ 2 callers
Method
CreateCLIAuthSession
CreateCLIAuthSession creates a new pending CLI auth session.
internal/cli/client.go:997
↓ 2 callers
Method
CreateComment
(wsSlug, itemSlug string, input models.CommentCreate)
internal/cli/client.go:384
↓ 2 callers
Method
CreateRefreshTokenSession
===================================================================== RefreshTokenStorage ============================================================
internal/oauth/storage.go:278
↓ 2 callers
Method
CreateWorkspace
(input models.WorkspaceCreate)
internal/cli/client.go:108
↓ 2 callers
Function
CredentialsPath
CredentialsPath returns ~/.pad/credentials.json.
internal/cli/credentials.go:74
↓ 2 callers
Function
Defaults
Defaults returns the six default collections for a new workspace.
internal/collections/defaults.go:20
↓ 2 callers
Method
DeleteAccessToken
DeleteAccessToken removes a row entirely (fosite uses Delete after successful exchange to prevent reuse). Distinct from RevokeAccessToken which preser
internal/store/oauth.go:331
↓ 2 callers
Method
DeleteInvitationAdmin
DeleteInvitationAdmin removes a pending invitation by ID (no workspace scoping).
internal/store/workspace_members.go:954
↓ 2 callers
Method
DeleteOAuthClient
DeleteOAuthClient removes a client AND every dependent row (auth codes, access tokens, refresh tokens, PKCE sessions) atomically. Why explicit cascad
internal/store/oauth.go:203
↓ 2 callers
Method
DeleteOAuthConnection
DeleteOAuthConnection removes the row + cascades to oauth_connection_workspaces. Phase D's "Revoke" handler calls this after RevokeRefreshTokenFamily
internal/store/oauth_connections.go:564
↓ 2 callers
Method
DeletePKCERequest
DeletePKCERequest removes the row after a successful /token exchange (fosite's lifecycle for PKCE is delete-on-use, unlike auth codes which are flagge
internal/store/oauth.go:539
↓ 2 callers
Method
DeleteSession
DeleteSession destroys a session by its plaintext token.
internal/store/sessions.go:211
↓ 2 callers
Method
DeleteSessionIfExists
DeleteSessionIfExists destroys a session by plaintext token and reports whether a row was actually deleted. Used by the IP-change strict-mode path as
internal/store/sessions.go:229
↓ 2 callers
Method
DeleteUserAPIToken
DeleteUserAPIToken removes an API token by ID, verifying it belongs to the user.
internal/store/api_tokens.go:204
↓ 2 callers
Function
DerivePrefix
DerivePrefix generates a short uppercase prefix from a collection name. Single word: first 3-5 chars, removing trailing "s" for plurals Multi-word: fi
internal/collections/prefix.go:38
↓ 2 callers
Method
DisableUser
DisableUser soft-disables a user account by setting disabled_at.
internal/store/users.go:885
↓ 2 callers
Method
Dispatch
Dispatch is the helper most fan-out actions use. Looks up cmdInfo in env.Doc, builds CLI args, attaches the dispatch input to ctx, forwards to env.Dis
internal/mcp/catalog.go:146
↓ 2 callers
Method
DownloadAttachment
DownloadAttachment streams the bytes of an attachment into w. Returns the Content-Type the server set and the number of bytes copied so callers can ve
internal/cli/client.go:1356
↓ 2 callers
Function
EmitMarkdown
EmitMarkdown walks the command tree below `target`, builds a cmdhelp v0.1 Document, and writes it to w as a markdown document with the predictable sec
internal/cmdhelp/md.go:21
↓ 2 callers
Method
Error
()
internal/server/handlers_import_bundle.go:535
↓ 2 callers
Method
FTSSnippet
FTSSnippet returns SQL for highlighted search result snippets. SQLite: snippet(fts_table, col_idx, '<mark>', '</mark>', '...', 32) — consumes ONE arg.
internal/store/dialect.go:93
↓ 2 callers
Function
FindAndCompileSchema
FindAndCompileSchema locates and compiles the cmdhelp v0.1 JSON Schema by walking up from `startDir` until it finds a directory containing `schema/cmd
internal/cmdhelp/schema.go:24
↓ 2 callers
Function
FormatAttachmentSize
FormatAttachmentSize returns a human-readable byte count ("832 B", "1.2 MB", "5 GB"). Negative sizes return "" — that's a corrupt-row signal, not some
internal/server/render/attachments.go:81
↓ 2 callers
Function
FormatFieldSummary
FormatFieldSummary returns a formatted summary of item fields. Example output: "status: open | priority: high | category: platform"
internal/cli/format.go:373
↓ 2 callers
Method
GetAgentRole
GetAgentRole gets a single agent role by ID or slug.
internal/cli/client.go:672
↓ 2 callers
Method
GetAuthorizeCodeSession
GetAuthorizeCodeSession hydrates the session for an auth code. The caller supplies an empty fosite.Session (typically &Session{}); we JSON-unmarshal t
internal/oauth/storage.go:196
↓ 2 callers
Method
GetBacklinks
GetBacklinks fetches the items that contain a `[[<itemRef>]]` reference to the queried item. Phase 1 returns ref-form backlinks only — title and cross
internal/cli/client.go:360
↓ 2 callers
Method
GetCollection
(wsSlug, collSlug string)
internal/cli/client.go:182
↓ 2 callers
Method
GetConventionLibrary
GetConventionLibrary fetches the convention library from the server. category — when non-empty, server-side filter against LibraryCategory.Name (case
internal/cli/client.go:527
↓ 2 callers
Method
GetItemCollectionRefs
GetItemCollectionRefs returns minimal item info (ID + CollectionID) for the given item IDs, scoped to the workspace. State-agnostic: the query has no
internal/store/items.go:4434
↓ 2 callers
Method
GetItemLineageByIDs
GetItemLineageByIDs fetches skinny parent-lineage projections for the given item IDs in a single `WHERE id IN (...)` query. Soft-deleted items are exc
internal/store/items.go:3201
↓ 2 callers
Method
GetPlaybookLibrary
GetPlaybookLibrary fetches the playbook library from the server. category — when non-empty, server-side filter against PlaybookCategory.Name (case-se
internal/cli/client.go:580
↓ 2 callers
Method
GetRefreshTokenSession
GetRefreshTokenSession hydrates a refresh token. Inactive rows surface as fosite.ErrInactiveToken — fosite's refresh-flow handler (handler/oauth2/flow
internal/oauth/storage.go:302
↓ 2 callers
Method
GetRoleBreakdown
GetRoleBreakdown returns item counts and assigned users grouped by agent role. Includes an entry for unassigned items (role_id = nil).
internal/store/agent_roles.go:174
↓ 2 callers
Method
GetUserByStripeCustomerID
GetUserByStripeCustomerID retrieves a user by their Stripe customer ID. Returns nil if no user is found with the given customer ID.
internal/store/limits.go:339
↓ 2 callers
Method
GetUserWorkspacesDetailed
GetUserWorkspacesDetailed returns each workspace this user is a member of with the per-workspace aggregations the admin modal's Workspaces tab renders
internal/store/workspace_members.go:1033
↓ 2 callers
Method
GuestVisibleCollectionIDs
GuestVisibleCollectionIDs returns the collection IDs a guest (non-member with grants) can see. Includes collections with direct collection_grants and
internal/store/grants.go:376
↓ 2 callers
Method
GuestVisibleResourcesIncludeDeleted
GuestVisibleResourcesIncludeDeleted is the delta-sync variant of GuestVisibleResources: it does NOT filter out soft-deleted items or collections. /ite
internal/store/grants.go:437
↓ 2 callers
Function
HasPadEntry
HasPadEntry returns whether mcpServers.pad is present, plus the current `command` value (empty string when missing). Missing files are reported as not
internal/mcp/install.go:292
↓ 2 callers
Method
HeadAttachment
HeadAttachment issues a HEAD request and returns the headers as structured metadata. Variant is forwarded the same way as DownloadAttachment — empty s
internal/cli/client.go:1401
↓ 2 callers
Function
IsAPITokenFromContext
IsAPITokenFromContext reports whether the request was authenticated via an API token (vs. a session cookie or CLI session token). Mirrors the package-
internal/server/context.go:71
↓ 2 callers
Function
IsAttachmentHref
IsAttachmentHref reports whether href is a `pad-attachment:UUID` reference.
internal/server/render/attachments.go:46
↓ 2 callers
Method
IsCloud
IsCloud reports whether the configured connection mode is Cloud (i.e. cfg.Mode == ModeCloud). This is a CLIENT-side signal: the CLI is configured to t
internal/config/config.go:305
↓ 2 callers
Method
IsEmailOptedOut
IsEmailOptedOut returns true if the given email address has unsubscribed.
internal/store/email_optouts.go:6
↓ 2 callers
Function
IsImageMime
IsImageMime reports whether the MIME type renders inline as an image. Mirrors `image/*` from the server-side allowlist (image/png, image/jpeg, image/g
internal/server/render/attachments.go:74
↓ 2 callers
Function
IsServerRunning
IsServerRunning checks if the server is currently running.
internal/cli/server.go:109
↓ 2 callers
Function
IsTerminal
IsTerminal returns true if stdin is a terminal (not piped/redirected).
internal/cli/skills.go:107
↓ 2 callers
Function
IsValidDocType
(t string)
internal/models/document.go:75
↓ 2 callers
Function
IsValidStatus
(s string)
internal/models/document.go:84
↓ 2 callers
Method
ListAllMCPAudit
ListAllMCPAudit is the admin-only full-table view used by the console/admin/mcp-audit page. limit + offset paginate; caller must restrict access at th
internal/store/mcp_audit.go:167
↓ 2 callers
Method
ListCollectionItems
ListCollectionItems returns items within a specific collection.
internal/cli/client.go:224
↓ 2 callers
Method
ListComments
--- Comments ---
internal/cli/client.go:379
↓ 2 callers
Method
ListConnectionWorkspaceSlugs
ListConnectionWorkspaceSlugs returns the join table's slug list for requestID, regardless of the parent connection's wildcard flag. Companion to Conne
internal/store/oauth_connections.go:393
↓ 2 callers
Method
ListDeletedWorkspaces
ListDeletedWorkspaces returns the soft-deleted workspaces the given user OWNS that are still inside the restore window — deleted_at set, newer than cu
internal/store/workspaces.go:348
↓ 2 callers
Method
ListDocumentActivityBeforeTime
ListDocumentActivityBeforeTime returns activities for a document created before the given time, ordered newest-first, limited to `limit` results. Used
internal/store/activities.go:450
↓ 2 callers
Method
ListItemVersionsBeforeTime
ListItemVersionsBeforeTime returns versions for an item created before the given time, ordered newest-first, limited to `limit` results. Used for curs
internal/store/items.go:4247
↓ 2 callers
Method
ListMCPAuditByConnection
ListMCPAuditByConnection returns the audit rows for one OAuth connection (or one PAT). Used by the per-connection drilldown the connected-apps page ex
internal/store/mcp_audit.go:138
↓ 2 callers
Method
ListPurgeableWorkspaces
ListPurgeableWorkspaces returns workspaces whose deleted_at is set and older than cutoff — i.e. soft-deleted long enough ago to hard-purge. Live works
internal/store/workspace_purge.go:57
↓ 2 callers
Method
ListReactionsByComments
ListReactionsByComments loads all reactions for a set of comment IDs, keyed by comment ID.
internal/store/reactions.go:65
↓ 2 callers
Method
ListShareLinks
ListShareLinks returns all share links for a target (item or collection).
internal/store/share_links.go:153
↓ 2 callers
Method
ListUserAPITokens
ListUserAPITokens returns all API tokens owned by a user (without secrets).
internal/store/api_tokens.go:167
↓ 2 callers
Method
ListUserActivity
ListUserActivity returns activities originated by the given user, in reverse-chronological order. Powers the Activity tab of the admin user modal (T15
internal/store/activities.go:318
↓ 2 callers
Method
ListViews
ListViews returns all views for a collection within a workspace.
internal/store/views.go:103
↓ 2 callers
Method
ListWorkspaceMembers
ListWorkspaceMembers returns all members of a workspace, enriched with user name and email from a join.
internal/store/workspace_members.go:106
↓ 2 callers
Method
ListWorkspaceTags
ListWorkspaceTags returns the distinct tags used across a workspace's items with the number of (non-archived) items carrying each, ordered by count de
internal/store/items.go:983
↓ 2 callers
Function
LoadPadToml
LoadPadToml finds and reads the nearest .pad.toml by walking up from cwd. Returns nil if no .pad.toml is found (not an error).
internal/cli/workspace.go:60
↓ 2 callers
Method
LogFile
()
internal/config/config.go:543
↓ 2 callers
Method
MCPBearerAuth
MCPBearerAuth is the auth gate for the /mcp Streamable HTTP endpoint. Behaviour, in order: 1. No Authorization header, or one that doesn't start wit
internal/server/middleware_mcp_auth.go:78
↓ 2 callers
Method
MigrateItemFieldValues
MigrateItemFieldValues bulk-updates items in a collection when select options are renamed. Each entry in renames maps old_value → new_value for the gi
internal/store/collections.go:366
↓ 2 callers
Method
MoveItemWithForce
MoveItemWithForce is the open-children-guard-aware variant of MoveItem (IDEA-1494 R3 P1). When `force` is true, the URL gets a `?force=true` query so
internal/cli/client.go:327
↓ 2 callers
Method
Normalize
Normalize sets pagination and sorting defaults on SearchParams.
internal/store/search.go:63
← previous
next →
1,101–1,200 of 6,005, ranked by callers