type
App
A resolved application bound to operation services.
Properties
| Property | Type | Description |
|---|---|---|
Manifest | func() schema.Manifest | Return the immutable resolved schema. |
Local | func() *LocalAPI | Return the in-process content API. |
Handler | func(HandlerOptions) http.Handler | Build the REST API, admin, plugin routes, health, and readiness handler. |
How it works
App owns initialized runtime services; its fields are intentionally private. Construct it with New, or let Execute own the ordinary production lifecycle.
Full signature
type App struct {
// contains filtered or unexported fields
}Methods
App.Manifest()Return the immutable resolved schema.
App.Local()Return the in-process content API.
App.Handler()Build the REST API, admin, plugin routes, health, and readiness handler.
App.AuthInitialized()Report whether an auth collection has any active account.
App.AuthBootstrapAvailable()Report whether one-time anonymous setup is available for the configured admin collection.
App.CreateAuthUser()CreateAuthUser creates an auth document and credential atomically while allowing a transport to populate the returned user safely.
App.Login()Authenticate one collection identity with a password.
App.Session()Resolve one raw session token and current user.
App.RotateSession()Atomically replace a valid bearer session.
App.Sessions()List safe active-session metadata for the bearer user.
App.RevokeSession()Revoke one session belonging to the bearer user.
App.Logout()Delete the presented session.
App.LogoutAll()Revoke every session for the presented identity.
App.ChangePassword()Verify the current password, replace it, and revoke all sessions and API keys.
App.RequestPasswordReset()Issue and send a single-use reset token when configured.
App.ResetPassword()Consume a single-use reset token and revoke credentials.
App.RequestVerification()Issue and send a new email-verification token.
App.VerifyEmail()Consume a single-use email-verification token.
App.CreateAPIKey()Mint a revocable API bearer secret for a current session.
App.AuthenticateAPIKeyIdentity()Resolve an API key to its exact auth identity.
App.AuthenticateExternalIdentity()Run compiled external strategies in declaration order.
App.Upload()Validate, store, and create an upload document atomically.
App.UploadFromURL()Safely fetch and store a public HTTP(S) asset.
App.OpenUploadWithOptions()Authorize a document-backed object read.
App.UpdateUpload()Commit replacement bytes, image edits, and document fields as one upload update.
App.ReconcileUploads()Report old unreferenced application-owned objects without deleting them.
App.SchedulePublish()Queue a revision-fenced future publish.
App.ScheduledPublications()List scheduled publications for one authorized document.
App.CancelScheduledPublication()Dismiss one scheduled publication for an authorized document.
App.RunScheduledPublications()Claim and run a bounded publication batch.
App.DocumentLock()Read one document lock after read authorization.
App.AcquireDocumentLock()Acquire, refresh, or explicitly take over an authoring lock.
App.CreateCollectionPreviewToken()Mint a token after read authorization.
App.FindCollectionPreview()Read the exact token-scoped draft without a session.
App.Preference()Read one opaque user-owned preference.
App.SetPreference()Validate and persist a bounded preference value.
App.DeletePreference()Delete one preference owned by an exact authenticated identity.
App.ResetPreferences()Delete every preference owned by an exact authenticated identity.
App.APIKeys()List safe active API-key metadata for the current session identity.
App.RevokeAPIKey()Revoke one API key belonging to the current session identity.
App.AuthenticateAPIKey()Resolve a bearer API key to its current user without creating a browser session.
App.PruneExpiredAuth()Remove one bounded batch of expired sessions and API keys.
App.ReleaseDocumentLock()Release only the exact authenticated identity’s document lease.
App.CreateGlobalPreviewToken()Mint a short-lived preview token for one draft global.
App.FindGlobalPreview()Read the exact token-scoped draft global without a session.
App.RevokePreviewToken()Revoke a preview capability owned by the exact authenticated identity.
App.RunTasks()Claim and execute one bounded durable-task batch.
App.CreateAuthUserForTransport()CreateAuthUserForTransport is the selection-aware transport form of CreateAuthUserForTransport.
App.SetPassword()Validate and replace a local password, then revoke existing sessions and API keys.
App.LoginWithOptions()Authenticate and record safe client metadata on the resulting session.
App.AuthenticateExternal()Run configured request strategies and return the recognized actor.
App.ForceUnlock()Clear an account lock for an exact authenticated identity.
App.UnlockAuthUser()Find an account by configured identity and clear its login lock.
App.Duplicate()Duplicate prepares fresh storage keys for uploads and cleans up staged objects on failure. It preserves exact actor identity and response selection while duplicating ordinary or upload documents.
App.DuplicateForIdentity()DuplicateForIdentity duplicates through one exact authenticated collection identity. A nil identity remains anonymous.
App.UploadForIdentity()Store a file for one exact authenticated collection identity.
App.UploadFromURLForIdentity()Fetch and store a remote file for one exact authenticated identity.
App.UpdateUploadForIdentity()Save an upload for one exact authenticated identity.
App.OpenUpload()Open an object after proving it belongs to an access-visible upload document.
App.OpenUploadForIdentity()Open an upload through one exact authenticated collection identity.
App.CleanupUploads()Delete orphan candidates reported by upload reconciliation.
App.CreateUploadGrants()CreateUploadGrants mints delivery URLs for uploads that the session's owner can currently read. Each grant is bound to the session: logout, revocation, rotation, a password change, or expiry invalidates it.
App.OpenUploadSourceForIdentity()OpenUploadSourceForIdentity reads the immutable source for an authenticated editor. Public upload delivery deliberately does not resolve source keys.
App.OpenUploadWithGrant()OpenUploadWithGrant streams one object authorized by a delivery grant. The grant's session and owner are reloaded, and the object is opened through the same collection read access as cookie delivery.
App.PreviewUploadForIdentity()PreviewUploadForIdentity downloads a bounded, SSRF-checked remote file without creating a document. Closing the reader releases its file-memory reservation.
App.ScheduleUnpublish()ScheduleUnpublish queues an unpublish for one exact authenticated identity.