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
↓ 29 callers
Method
SetMemberCollectionAccess
SetMemberCollectionAccess updates a member's collection_access mode and replaces their specific collection grants atomically.
internal/store/workspace_members.go:252
↓ 29 callers
Function
isCollectionVisible
isCollectionVisible checks if a collection ID is in the visible set. If visibleIDs is nil, all collections are visible.
internal/server/server.go:2246
↓ 29 callers
Function
newRestrictedOwnerVisibilityFixture
(t *testing.T)
internal/server/handlers_grant_visibility_test.go:33
↓ 29 callers
Function
refOf
refOf builds a PREFIX-NUMBER string from a fresh item — used by the integration tests since the canonical ref isn't on the model directly. ItemNumber
internal/store/wiki_links_test.go:543
↓ 28 callers
Method
Driver
Driver returns the driver type.
internal/store/dialect.go:20
↓ 28 callers
Function
errorHandler
errorHandler fails the test if invoked. Used to assert that a code path doesn't hit the handler at all.
internal/mcp/dispatch_http_advanced_test.go:891
↓ 27 callers
Method
DB
DB returns the underlying *sql.DB (for use in migrations/testing).
internal/store/store.go:75
↓ 27 callers
Method
Set
Set adds or replaces the credential for the given server URL. The canonical URL is mirrored into the value's ServerURL field so a caller reading the c
internal/cli/credentials.go:185
↓ 27 callers
Function
cancel
()
web/src/lib/items/contentSaver.svelte.ts:68
↓ 27 callers
Function
liveCmdhelpDoc
liveCmdhelpDoc returns a minimal cmdhelp.Document with every command path the read-only catalog references. Lighter than re-running pad's full cobra e
internal/mcp/catalog_readonly_test.go:430
↓ 26 callers
Function
New
New creates a new Metrics instance with a custom registry and registers all application metrics plus Go runtime and process collectors.
internal/metrics/metrics.go:60
↓ 26 callers
Function
newTransitionTestWorkspace
(t *testing.T, s *Store)
internal/store/status_transitions_test.go:48
↓ 25 callers
Function
cloudAdminReq
cloudAdminReq is a small helper that builds a request with optional JSON body and the caller-chosen headers.
internal/server/cloud_admin_gate_test.go:19
↓ 25 callers
Function
newCollabTestServer
newCollabTestServer wires up an httptest server whose only handler upgrades the inbound WS, registers it with the manager, and waits for the session t
internal/collab/manager_test.go:240
↓ 24 callers
Method
GetWorkspaceMember
GetWorkspaceMember retrieves a single membership record.
internal/store/workspace_members.go:82
↓ 24 callers
Function
New
New creates a Store backed by SQLite at the given path. The DSN is configured for safe concurrent use under Go's connection pool: - `_pragma=busy_ti
internal/store/store.go:141
↓ 24 callers
Function
doAuthedRequest
doAuthedRequest is like doRequest but with a session cookie + the matching User-Agent attached (SessionAuth UA-binding, see middleware_auth.go:186).
internal/server/handlers_oauth_test.go:2379
↓ 22 callers
Method
IsEmailVerified
IsEmailVerified returns true if the user's email address has been verified. Mirrors IsDisabled: a non-empty EmailVerifiedAt timestamp means verified,
internal/models/user.go:42
↓ 22 callers
Function
New
New creates a new in-memory EventBus with default replay buffer settings.
internal/events/bus.go:224
↓ 22 callers
Function
classifyHTTPStatus
classifyHTTPStatus is the legacy entry point preserved for callers that don't know their resource kind. New callers should use classifyHTTPStatusKind
internal/mcp/errors.go:728
↓ 22 callers
Function
dialWS
(t *testing.T, server *httptest.Server, itemID string)
internal/collab/manager_test.go:265
↓ 21 callers
Method
BoolToInt
BoolToInt converts a Go bool to a query parameter value. SQLite: 0/1 (integers) PostgreSQL: true/false (native booleans)
internal/store/dialect.go:69
↓ 21 callers
Function
BuildCLIArgs
BuildCLIArgs translates an MCP tool call's JSON arguments into the CLI argument list that should be appended after the command path. Pure function — n
internal/mcp/dispatch.go:362
↓ 21 callers
Method
DeleteItem
DeleteItem soft-deletes the item by stamping deleted_at and bumping the workspace-scoped seq so delta-sync clients see the tombstone. The seq bump use
internal/store/items.go:2331
↓ 21 callers
Function
NewErrorResult
NewErrorResult packages an ErrorPayload as an MCP CallToolResult with IsError=true. Both the JSON envelope and a human-readable summary are returned:
internal/mcp/errors.go:228
↓ 21 callers
Function
actorFromRequest
actorFromRequest derives actor and source from the request's auth context. Actor is "user" or "agent" (determined by X-Pad-Agent header). Source is "w
internal/server/handlers_documents.go:250
↓ 21 callers
Function
buildSyntheticTree
buildSyntheticTree returns a small cobra tree exercising the shapes the emitter has to handle: subgroups, leaf commands with positional args, flags of
internal/cmdhelp/json_test.go:26
↓ 21 callers
Method
set
(workspaceID string, info *store.WorkspaceStorageInfo)
internal/server/handlers_storage.go:77
↓ 20 callers
Method
CreateCollectionGrant
--- Collection Grants --- CreateCollectionGrant creates a direct grant on a collection for a user.
internal/store/grants.go:13
↓ 20 callers
Method
CreateItemLink
--- Item Links ---
internal/store/items.go:2551
↓ 20 callers
Method
CreateOAuthClient
============================================================ Clients (RFC 7591 — Dynamic Client Registration) ========================================
internal/store/oauth.go:79
↓ 20 callers
Function
NewSession
NewSession constructs a Session with the given subject (pad user ID). Returns a non-nil DefaultSession so the embedded methods don't panic on a zero-v
internal/oauth/session.go:49
↓ 20 callers
Method
Resolve
Resolve returns the store responsible for key, or an error if no matching backend is registered. The key format is "<prefix>:<rest>".
internal/attachments/registry.go:48
↓ 20 callers
Method
logAuditEvent
logAuditEvent logs a non-workspace audit event (e.g. login, logout). Best-effort: errors are silently ignored.
internal/server/handlers_documents.go:333
↓ 20 callers
Function
loginUser
(t *testing.T, srv *Server, email, password string)
internal/server/handlers_rbac_test.go:92
↓ 20 callers
Function
workspaceIDForSlug
workspaceIDForSlug looks up the internal UUID for a slug — used by tests that synthesize attachment rows directly via the store (bypassing the upload
internal/server/handlers_storage_test.go:425
↓ 19 callers
Method
BaseURL
BaseURL returns the configured base URL.
internal/email/sender.go:94
↓ 19 callers
Method
CreateOAuthConnection
CreateOAuthConnection inserts a new connection row. Idempotent in the sense that callers should INSERT once per /authorize/decide; if the same request
internal/store/oauth_connections.go:216
↓ 19 callers
Method
GetAttachment
GetAttachment returns the attachment with the given id, or (nil, nil) if no such row exists. Soft-deleted rows ARE returned (so download handlers can
internal/store/attachments.go:98
↓ 19 callers
Function
LoadStore
LoadStore reads the credentials file and returns a usable CredentialStore. Returns an empty (but non-nil) store if the file doesn't exist — that's not
internal/cli/credentials.go:96
↓ 19 callers
Method
post
(path string, body interface{}, result interface{})
internal/cli/client.go:1532
↓ 19 callers
Function
validationFailedResult
───────────────────────────────────────────────────────────────────── Helpers for non-HTTP error paths (TASK-1077 — replace plain-string NewToolResult
internal/mcp/errors.go:1230
↓ 18 callers
Function
Encode
Encode serializes an Artifact to its portable on-disk form: --- <yaml frontmatter> --- <body> Output is deterministic: two Encode calls on the
internal/artifact/encode.go:23
↓ 18 callers
Method
Rebind
Rebind converts a query with "?" placeholders to the dialect's format. For SQLite this is a no-op. For PostgreSQL, "?" becomes "$1", "$2", etc.
internal/store/dialect.go:28
↓ 18 callers
Method
ServeHTTP
(w http.ResponseWriter, r *http.Request)
internal/mcp/dispatch_http_test.go:44
↓ 18 callers
Method
addEventListener
(type: 'toolchange', listener: (ev: Event) => void)
web/src/lib/webmcp/types.d.ts:78
↓ 18 callers
Function
clientIP
clientIP extracts the client IP from RemoteAddr. This is safe because TrustedProxyRealIP runs earlier in the chain and — when a trusted proxy is confi
internal/server/middleware_ratelimit.go:532
↓ 18 callers
Function
connectedAppsTestServer
Connected-apps handler tests (PLAN-943 TASK-954). What's covered: - GET /api/v1/connected-apps requires cloud mode (404 outside). - List returns onl
internal/server/handlers_connected_apps_test.go:50
↓ 18 callers
Function
equalSlice
equalSlice is a small helper for stable []string comparison; kept here so test files across the package can share it. catalog_test.go has equalString
internal/mcp/registry_test.go:188
↓ 18 callers
Method
logAuditEventForUser
logAuditEventForUser logs an audit event with an explicit user ID. Use this when the user isn't (yet) in the request context, e.g. after a successful
internal/server/handlers_documents.go:340
↓ 18 callers
Function
requireAdmin
--- Helpers ---
internal/server/handlers_admin_users.go:844
↓ 18 callers
Method
requireEditPermission
requireEditPermission checks if the user has edit access to the given item. For regular members (editor/owner), this uses the standard role check. For
internal/server/server.go:2343
↓ 18 callers
Function
sessionCookieName
sessionCookieName returns the session cookie name. When running over TLS (secureCookies=true), the __Host- prefix is used to prevent subdomain cookie
internal/server/handlers_auth.go:45
↓ 18 callers
Function
setupRBACEnv
(t *testing.T)
internal/server/handlers_rbac_test.go:24
↓ 17 callers
Method
GetPlatformSetting
GetPlatformSetting returns a single platform setting value, or empty string if not set.
internal/store/platform_settings.go:6
↓ 17 callers
Method
GetReport
GetReport computes the windowed project report for a workspace.
internal/store/reports.go:197
↓ 17 callers
Method
ResolveItemIncludeDeleted
ResolveItemIncludeDeleted is like ResolveItem but includes soft-deleted items.
internal/store/items.go:531
↓ 17 callers
Method
SetCloudSidecar
SetCloudSidecar installs the reverse pad → pad-cloud client. Called from cmd/pad/main.go when PAD_CLOUD_SIDECAR_URL + PAD_CLOUD_SECRET are set. When u
internal/server/server.go:472
↓ 17 callers
Function
ValidateFields
ValidateFields checks field values against the collection schema. It validates required fields are present, types are correct, and select values are w
internal/items/validate.go:41
↓ 17 callers
Function
dispatcherErrorResult
dispatcherErrorResult wraps an internal dispatcher failure (build request, encode body, parse response, marshal merged fields, etc.) into the structur
internal/mcp/errors.go:1248
↓ 17 callers
Function
strPtr
(s string)
internal/store/timeline_pagination_test.go:186
↓ 17 callers
Function
testStoreOAuth
Tests for the OAuth server constructor + audience strategy + storage adapter (PLAN-943 TASK-951 sub-PR B). Each layer is covered: - NewServer: requir
internal/oauth/server_test.go:40
↓ 16 callers
Method
CreateAccessToken
============================================================ Access tokens (handler/oauth2/storage.go AccessTokenStorage) ============================
internal/store/oauth.go:310
↓ 16 callers
Method
GetOAuthConnection
GetOAuthConnection fetches the connection row by request_id. Returns ErrOAuthConnectionNotFound if no row exists; any other error is a real I/O failur
internal/store/oauth_connections.go:106
↓ 16 callers
Method
Publish
Publish sends an event to all subscribers for the event's workspace.
internal/events/bus.go:112
↓ 16 callers
Method
ResolveItem
ResolveItem looks up an item by UUID, PREFIX-NUMBER ref (e.g. "IDEA-15"), or slug. UUID is tried first, then ref, then slug.
internal/store/items.go:488
↓ 16 callers
Method
SetParentLink
--- Phase Links --- SetParentLink sets the parent for an item. Since an item can belong to at most one parent, this deletes any existing parent link f
internal/store/items.go:2832
↓ 16 callers
Function
classifyExecError
classifyExecError turns an exec.Cmd failure (err + stderr) into a structured envelope. lookup is optional — when supplied, no_workspace errors get ava
internal/mcp/errors.go:435
↓ 16 callers
Function
createTestDoc
(t *testing.T, s *Store, workspaceID, title, content string)
internal/store/store_test.go:257
↓ 15 callers
Method
Close
Close stops every active room AND blocks until every in-flight Join goroutine has returned. After Close, Join is undefined — callers must coordinate s
internal/collab/manager.go:792
↓ 15 callers
Method
CreateAttachment
CreateAttachment inserts an attachment row. id and created_at are generated by the store. The caller is expected to have already written the blob via
internal/store/attachments.go:68
↓ 15 callers
Method
CreateItemGrant
--- Item Grants --- CreateItemGrant creates a direct grant on an item for a user.
internal/store/grants.go:101
↓ 15 callers
Function
DefaultConfig
()
internal/config/config.go:89
↓ 15 callers
Method
GetCollection
(id string)
internal/store/collections.go:63
↓ 15 callers
Function
GetTemplate
GetTemplate returns the workspace template with the given name, or nil if no template with that name exists.
internal/collections/templates.go:907
↓ 15 callers
Method
JSONExtractText
JSONExtractText returns SQL to extract a text value from a JSON column. SQLite: json_extract(col, '$.key') PostgreSQL: col->>'key'
internal/store/dialect.go:33
↓ 15 callers
Function
NewProcessor
NewProcessor returns the Processor compiled into this binary. Pure-Go build → pureGoProcessor. libvips build → vipsProcessor (Phase 2). Constructed o
internal/attachments/processor_purego.go:43
↓ 15 callers
Method
SeedDefaultCollections
SeedDefaultCollections rescues a workspace that ended up with zero collections by seeding it with the standard Software-shape Defaults(). It is intent
internal/store/collections.go:467
↓ 15 callers
Method
UserCount
UserCount returns the total number of registered users.
internal/store/users.go:573
↓ 15 callers
Method
bearerHeaders
()
internal/server/handlers_grant_visibility_test.go:104
↓ 15 callers
Method
bearerHeaders
()
internal/server/handlers_items_test.go:2624
↓ 15 callers
Function
postOAuthForm
postOAuthForm POSTs an x-www-form-urlencoded body without any auth (used for /oauth/revoke + /oauth/token, where client_id rides in the form for publi
internal/server/handlers_oauth_test.go:2537
↓ 15 callers
Function
runAuthCodeFlow
runAuthCodeFlow drives a full /oauth/authorize/decide → /oauth/token exchange and returns the parsed token JSON. Each invocation needs a unique verifi
internal/server/handlers_oauth_test.go:2473
↓ 15 callers
Function
seedParentAndChildren
seedParentAndChildren creates a plan + N child tasks with the given statuses (one per child), returning the parent and the slice of child refs in crea
internal/server/handlers_items_open_children_guard_test.go:24
↓ 14 callers
Method
Apply
Apply walks doc and stamps EnumSource + resolved Enum values on matching args and flags. Resolution failures are silent: the document continues to adv
internal/cmdhelp/dynamic.go:113
↓ 14 callers
Function
NewStorage
NewStorage wraps a *store.Store as a fosite-compatible adapter. The store must be a fully-initialized pad store (migrations applied); no validation he
internal/oauth/storage.go:129
↓ 14 callers
Method
SeedCollectionsFromTemplate
SeedCollectionsFromTemplate seeds the workspace with collections from the named template. An empty template name materializes the default collections
internal/store/collections.go:503
↓ 14 callers
Method
SubscriberCount
SubscriberCount returns the number of active subscribers whose itemID matches. Used by the room manager to decide when the active peer count has dropp
internal/collab/memory_bus.go:154
↓ 14 callers
Function
doRequestWithBearer
doRequestWithBearer dispatches a request with an Authorization: Bearer header set. The existing test helpers in server_test.go don't take a token para
internal/server/middleware_auth_public_paths_test.go:25
↓ 14 callers
Function
doTransform
(srv *Server, slug, attachmentID string, body transformRequestBody)
internal/server/handlers_attachments_transform_test.go:29
↓ 14 callers
Function
isBearerAuth
isBearerAuth reports whether the request was authenticated via an Authorization: Bearer header rather than a browser session cookie. True for: PATs on
internal/server/middleware_auth.go:498
↓ 14 callers
Function
mcpAndOAuthEnabledTestServer
===================================================================== mcp ↔ OAuth integration (sub-PR E, TASK-1027) ==================================
internal/server/handlers_mcp_test.go:405
↓ 14 callers
Method
newRequest
newRequest creates an http.Request with auth and agent headers set.
internal/cli/client.go:1505
↓ 14 callers
Function
postFormWithCookie
postFormWithCookie POSTs an x-www-form-urlencoded body with both a session cookie and the matching CSRF cookie set, plus the session-bound User-Agent.
internal/server/handlers_oauth_test.go:2403
↓ 14 callers
Function
testServerWithEvents
(t *testing.T)
internal/server/handlers_events_test.go:20
↓ 13 callers
Method
AppendYjsUpdate
(itemID string, data []byte, schemaVersion string)
internal/collab/room.go:134
↓ 13 callers
Method
BackfillOAuthConnections
BackfillOAuthConnections walks every distinct grant chain found in oauth_access_tokens and oauth_refresh_tokens, parses the newest chain row's session
internal/store/oauth_connections_backfill.go:93
↓ 13 callers
Method
Close
Close shuts down the event bus and cleans up resources.
internal/events/bus.go:120
↓ 13 callers
Method
CreateShareLink
CreateShareLink creates a new share link and returns it with the raw token. The raw token is only available in this response — it is not stored.
internal/store/share_links.go:47
↓ 13 callers
Method
Dispatch
(ctx context.Context, cmdPath []string, cliArgs []string)
internal/mcp/dispatch.go:40
← previous
next →
101–200 of 6,005, ranked by callers