Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PerpetualSoftware/pad
/ functions
Functions
11,926 in github.com/PerpetualSoftware/pad
⨍
Functions
11,926
◇
Types & classes
1,272
↓ 20 callers
Function
multiDefaultSchema
A `multi_relation` DEFAULT, and `required` on one (PLAN-2857 U4, codex round 1's P2 and P3). Both were the same defect in two places: a gate reading
internal/store/relation_multi_defaults_test.go:18
↓ 20 callers
Function
mustItem
(t *testing.T, srv *Server, wsID, collID, title string)
internal/server/authz_cross_workspace_test.go:114
↓ 20 callers
Function
u1RelationSchema
Referent validation for relation values (PLAN-2857 U1 / TASK-2878). These are the STORE-level rules — does the value name a live item in the declared
internal/store/relation_referents_test.go:21
↓ 20 callers
Function
watchNotificationVisible
watchNotificationVisible decides whether a Notification should be delivered to a caller holding the given watch map. Extracted from the handler so the
internal/server/handlers_watch_events.go:628
↓ 20 callers
Function
writeOutboxTx
writeOutboxTx appends one canonical event to the outbox on the caller's transaction. Two rejections, both deliberately hard errors that fail the encl
internal/store/event_outbox.go:368
↓ 19 callers
Function
CoerceFields
CoerceFields converts STRING field values to the type the collection schema declares, so every write door stores the same native type for the same inp
internal/items/coerce.go:46
↓ 19 callers
Method
DeleteCollection
DeleteCollection soft-deletes a collection by id. When expectedUpdatedAt is non-empty it opts into optimistic-concurrency control (BUG-2265): the row'
internal/store/collections.go:748
↓ 19 callers
Method
ListDocumentActivity
(documentID string, params models.ActivityListParams)
internal/store/activities.go:741
↓ 19 callers
Method
Listen
Listen builds the HTTP server and binds addr, returning the listener without accepting on it yet. A failure here is the "address already in use" case,
internal/server/server.go:2172
↓ 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
SetWatchEventsBus
SetWatchEventsBus attaches the watch/nudge notification bus consumed by GET /api/v1/events/stream (TASK-2533). Nil-checked by every producer and by th
internal/server/server.go:848
↓ 19 callers
Method
UserCount
UserCount returns the total number of registered users.
internal/store/users.go:578
↓ 19 callers
Function
bodyDecodesNUL
bodyDecodesNUL reports whether any string a handler could read out of this JSON body — an object key or a value, at any nesting depth, including insid
internal/server/middleware_request_text.go:488
↓ 19 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:490
↓ 19 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
↓ 19 callers
Function
installStub
(t *testing.T, dir, name string)
internal/buildtools/install_refresh_test.go:127
↓ 19 callers
Function
killStub
(t *testing.T, name string)
internal/buildtools/install_refresh_test.go:140
↓ 19 callers
Function
newGCClaimFixture
(t *testing.T)
internal/store/attachments_gc_claim_test.go:23
↓ 19 callers
Function
newLocalOnlyBus
newLocalOnlyBus builds a RedisBus without starting its subscription, for the tests that exercise the local fan-out path directly. Constructing through
internal/watchevents/redis_bus_test.go:55
↓ 19 callers
Function
requireScriptDeps
uniqueName returns a stub name that is unique per test and under the 15-character comm limit pgrep -x matches on. requireScriptDeps skips when the env
internal/buildtools/install_refresh_test.go:75
↓ 19 callers
Method
restrictedEditor
--- authorization: the four checks, in order -------------------------- restrictedEditor returns an editor in both workspaces whose membership in each
internal/server/handlers_items_copy_preflight_test.go:652
↓ 19 callers
Method
snapshot
()
internal/events/observer_test.go:109
↓ 19 callers
Function
uniqueName
(t *testing.T)
internal/buildtools/install_refresh_test.go:114
↓ 18 callers
Method
Error
()
internal/attachments/mime.go:502
↓ 18 callers
Function
ExtractWikiLinks
ExtractWikiLinks scans `content` for [[...]] occurrences OUTSIDE any fenced or inline code region, parses each into a WikiLinkRef, and returns them in
internal/links/extract.go:510
↓ 18 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
↓ 18 callers
Method
GetReport
GetReport computes the windowed project report for a workspace.
internal/store/reports.go:180
↓ 18 callers
Method
Put
Put writes the blob from r into the backend, addressable by hash. The implementation MUST verify that the bytes streamed from r hash to the supplied h
internal/attachments/store.go:41
↓ 18 callers
Method
Save
Save writes the persisted Pad config to disk.
internal/config/config.go:522
↓ 18 callers
Method
Unsubscribe
Unsubscribe removes a local subscriber and closes its channel. Cancels the Redis subscription if this was the last local subscriber for the workspace.
internal/events/redis_bus.go:1251
↓ 18 callers
Method
Unsubscribe
Unsubscribe removes a subscriber and closes its channel. Safe to call with an already-removed channel — no-op in that case.
internal/collab/bus.go:102
↓ 18 callers
Function
assertAllowed
(t *testing.T, got CrossWorkspaceAccess, label string)
internal/server/authz_cross_workspace_test.go:186
↓ 18 callers
Method
bearerHeaders
()
internal/server/handlers_items_test.go:2626
↓ 18 callers
Method
buildAuthedRequest
( ctx context.Context, method, urlPath string, body []byte, user *models.User, )
internal/mcp/dispatch_http.go:586
↓ 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
Method
copyOK
copyOK issues the copy as the owner and requires a 201.
internal/server/handlers_items_copy_test.go:94
↓ 18 callers
Function
createViaTx
Tests for createItemTx — the tx-taking counterpart of CreateItem (PLAN-2357 / DR-9a). Each test below pins one line of the DR-9a parity checklist: slu
internal/store/items_create_tx_test.go:22
↓ 18 callers
Function
freePort
(t *testing.T)
internal/buildtools/install_refresh_test.go:145
↓ 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:445
↓ 18 callers
Function
release
()
web/src/lib/a11y/viewerBackdrop.ts:233
↓ 18 callers
Function
requireAdmin
--- Helpers ---
internal/server/handlers_admin_users.go:844
↓ 18 callers
Method
reset
(reason string)
internal/watchevents/observer.go:180
↓ 18 callers
Method
seedNeverAttached
seedNeverAttached inserts a never-attached attachment row aged past any grace cutoff a test will use.
internal/store/attachments_gc_claim_test.go:42
↓ 18 callers
Function
setupRBACEnv
(t *testing.T)
internal/server/handlers_rbac_test.go:24
↓ 18 callers
Method
storedRelation
storedRelation reads owner_ref back out of the database. Deliberately not the response body: a handler that echoed the right thing while writing the w
internal/server/relation_referents_doors_test.go:141
↓ 17 callers
Method
ApplyExternalContent
ApplyExternalContent routes an external content update through a designated applier when an active room exists. Returns nil on success; one of the sen
internal/collab/applier.go:253
↓ 17 callers
Method
GetItemIncludeDeleted
GetItemIncludeDeleted finds an item by id including soft-deleted items. Used by code paths that need to act on records the user already owns even thou
internal/store/items.go:1014
↓ 17 callers
Method
ListWorkspaces
(ctx context.Context)
internal/mcp/errors.go:322
↓ 17 callers
Method
RestoreItem
RestoreItem un-archives a soft-deleted item and bumps the workspace-scoped seq so delta-sync clients re-materialize the row. Same lock + subquery shap
internal/store/items.go:3108
↓ 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:645
↓ 17 callers
Method
SetEventBus
SetEventBus attaches an event bus for real-time SSE streaming.
internal/server/server.go:840
↓ 17 callers
Function
SniffMIME
SniffMIME detects the MIME type from the leading bytes of a payload using net/http's stdlib detector (the same RFC 6838 algorithm browsers use). The r
internal/attachments/mime.go:249
↓ 17 callers
Method
ValidateSession
ValidateSession hashes the provided token, looks it up, checks expiry, and returns the session info including the associated user and binding metadata
internal/store/sessions.go:62
↓ 17 callers
Function
__resetViewerBackdropForTests
()
web/src/lib/a11y/viewerBackdrop.ts:496
↓ 17 callers
Method
acquireWorkspaceSeqLock
acquireWorkspaceSeqLock takes a Postgres advisory transaction lock keyed on the workspace ID so concurrent seq-bumping mutations serialize. The lock a
internal/store/items.go:122
↓ 17 callers
Function
actorNameFromRequest
actorNameFromRequest returns the authenticated user's display name, or empty string.
internal/server/handlers_documents.go:345
↓ 17 callers
Method
callAs
callAs is `call` with an explicit user and workspace role, for the legs that need someone other than the fixture owner.
internal/server/relation_referents_doors_test.go:621
↓ 17 callers
Method
createLink
createLink mints a share link for the fixture's item or collection.
internal/server/handlers_share_attachments_test.go:182
↓ 17 callers
Function
doArtifactRequest
doArtifactRequest posts a raw (non-JSON) body to an artifact-import endpoint.
internal/server/handlers_artifact_test.go:17
↓ 17 callers
Method
newRequest
newRequest creates an http.Request with auth and agent headers set.
internal/cli/client.go:1947
↓ 17 callers
Function
readFixture
readFixture loads one of the real encoder outputs described in testdata/README.md. Every ISO-BMFF acceptance assertion in this file runs on those byte
internal/attachments/mime_isobmff_test.go:16
↓ 17 callers
Method
release
* Drop the lease. `released` is false on a repeat call (no-op). `stackEmpty` * reports whether any lease remains AFTER this release — the caller use
web/src/lib/a11y/viewerBackdrop.ts:37
↓ 17 callers
Method
runReminderTick
runReminderTick is one pass: fire every reminder whose instant has arrived. The store does the arbitration and writes each event in the same transact
internal/server/reminder_tick.go:141
↓ 17 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
↓ 17 callers
Method
setContent
setContent overwrites an item's markdown body.
internal/server/handlers_share_attachments_test.go:172
↓ 17 callers
Function
testServerWithPresence
testServerWithPresence gives a server both the watch bus and the presence registry — the production pairing (cmd_server.go wires them on adjacent line
internal/server/handlers_sessions_test.go:19
↓ 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
Add
Add implements SessionPresence. Returns the generated id even when the Redis write fails. That is deliberate and it is the same posture the rest of t
internal/server/session_presence_redis.go:458
↓ 16 callers
Method
CreateAccessToken
============================================================ Access tokens (handler/oauth2/storage.go AccessTokenStorage) ============================
internal/store/oauth.go:310
↓ 16 callers
Method
CreateReminder
CreateReminder arms a reminder on an item. THE ITEM MUST BE A LIVE ITEM OF THIS WORKSPACE, and that is asserted by the INSERT itself rather than by a
internal/store/reminders.go:156
↓ 16 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
↓ 16 callers
Method
CreateWorkspace
(input models.WorkspaceCreate)
internal/cli/client.go:125
↓ 16 callers
Method
GetPlatformSetting
GetPlatformSetting returns a single platform setting value, or empty string if not set.
internal/store/platform_settings.go:6
↓ 16 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
↓ 16 callers
Function
NewRedisSessionPresence
NewRedisSessionPresence returns a shared registry backed by client. The client is the SAME one the watch bus uses (cmd/pad/cmd_server.go dials once o
internal/server/session_presence_redis.go:420
↓ 16 callers
Method
SetObserver
SetObserver attaches an Observer. Passing nil detaches. Safe to call after the bus is running; cmd/pad/cmd_server.go calls it at wiring time.
internal/watchevents/observer.go:157
↓ 16 callers
Method
SetSessionPresence
SetSessionPresence attaches the live-session registry read by GET /api/v1/sessions and written by GET /api/v1/events/stream (PLAN-2558 S1). Nil-checke
internal/server/server.go:858
↓ 16 callers
Method
SetUserPlan
SetUserPlan updates a user's billing plan.
internal/store/limits.go:327
↓ 16 callers
Function
WithTokenAllowedWorkspaces
WithTokenAllowedWorkspaces returns ctx decorated with the OAuth token's workspace allow-list set at consent time (TASK-952). The list is either a set
internal/server/context.go:150
↓ 16 callers
Function
contextWithWorkspaceRoleForTest
contextWithWorkspaceRoleForTest / contextWithResolvedWorkspaceIDForTest stash the two values RequireWorkspaceAccess populates for the REQUEST's worksp
internal/server/authz_cross_workspace_test.go:19
↓ 16 callers
Method
cycledCount
()
internal/events/observer_test.go:73
↓ 16 callers
Method
fanOutFromRedis
fanOutFromRedis is the receive path: a message that arrived on the subscription identified by gen, carrying the ID space it belongs to. A zero epoch
internal/events/redis_bus.go:2444
↓ 16 callers
Method
getAsset
getAsset issues GET on the asset endpoint. rawQuery is appended verbatim (already URL-formed, no leading '?').
internal/server/handlers_share_attachments_test.go:214
↓ 16 callers
Function
getOnlyAttachmentID
getOnlyAttachmentID returns the ID of the single live attachment row in a workspace — the test infrastructure uploads at most one blob per call, so th
internal/server/handlers_storage_test.go:410
↓ 16 callers
Function
imageRef
(id string)
internal/server/handlers_share_attachments_test.go:179
↓ 16 callers
Function
newMovedToFixture
(t *testing.T)
internal/server/item_moved_to_test.go:49
↓ 16 callers
Function
setupPushTest
setupPushTest mirrors setupItemOpenTest (item_open_test.go): points getClient()/getWorkspace() at a fake httptest server via the same urlFlag/workspac
cmd/pad/cmd_push_test.go:14
↓ 16 callers
Method
writeItemResolveError
writeItemResolveError distinguishes a soft-deleted (archived) item from a genuinely-missing one for mutation handlers. An archived item still appears
internal/server/handlers_items.go:978
↓ 15 callers
Method
Add
Add implements SessionPresence.
internal/server/session_presence.go:348
↓ 15 callers
Method
ClaimPendingOutboxEvents
ClaimPendingOutboxEvents claims up to limit pending events for one drain pass and returns them, oldest first. WHY A CLAIM AT ALL. Pad Cloud runs N in
internal/store/event_outbox.go:1792
↓ 15 callers
Method
DeleteWorkspace
(slug string)
internal/store/workspaces.go:302
↓ 15 callers
Method
FireDueReminders
THE FIRE-PATH INVARIANT, stated once so the next change is measured against it rather than against the last bug: THE CANDIDATE SCAN IS A HINT AND MA
internal/store/reminders.go:606
↓ 15 callers
Method
IsConfigured
IsConfigured reports whether the client has an explicit global connection configuration, either from config.toml or an environment/flag override.
internal/config/config.go:564
↓ 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
MigrateFields
MigrateFields maps field values from a source schema to a target schema. Fields with matching keys and compatible types are transferred. Incompatible
internal/items/migrate.go:62
↓ 15 callers
Method
MoveItem
MoveItem moves an item to a different collection within the same workspace. It updates the collection_id and fields JSON. The item_number is preserved
internal/store/items.go:4942
↓ 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:997
↓ 15 callers
Method
UpdateItemWithParentLink
UpdateItemWithParentLink is UpdateItemWithPreCheck plus an OPTIONAL parent-link mutation applied inside the same transaction (BUG-2013). When parentLi
internal/store/items.go:2228
↓ 15 callers
Method
archiveSource
()
internal/server/item_moved_to_test.go:108
← previous
next →
301–400 of 11,926, ranked by callers