Module
ridu
github.com/riducms/ridu — Configure a Ridu application, start its server, and define access rules.
Functions 8
ridu.New()Create an application from config and a document store.
ridu.Resolve()Resolve executable config into a deterministic schema manifest.
ridu.Execute()Run the API, admin, jobs, and shutdown lifecycle.
ridu.Allow()Allow an access-controlled operation.
ridu.Deny()Deny an access-controlled operation.
ridu.Where()Constrain access to documents matching a query expression.
ridu.NewAdminLoader()Define a Go read function whose result is supplied to an admin component.
ridu.Reject()Reject stops an operation from a collection, global, or field hook and shows message to the person who made the request. The admin displays it, and REST, the SDK, and the Local API return it as a "rejected" error (HTTP 422). Any other hook error is reported as an internal failure.
Types 14
type ridu.ConfigThe complete author-owned application definition.
type ridu.CollectionPublic authoring and runtime contracts live in core. These aliases keep the root package as the ergonomic application-facing entry point.
type ridu.GlobalPublic authoring and runtime contracts live in core. These aliases keep the root package as the ergonomic application-facing entry point.
type ridu.AdminLoadContextRead content for the signed-in user while a Go admin loader runs.
type ridu.AdminLoaderDefinitionA Go admin loader ready to register in your application's Admin.Loaders.
type ridu.BulkOptionsPublic authoring and runtime contracts live in core. These aliases keep the root package as the ergonomic application-facing entry point.
type ridu.PublicationScheduleOptionsPublic authoring and runtime contracts live in core. These aliases keep the root package as the ergonomic application-facing entry point.
type ridu.RemoteUploadInputPublic authoring and runtime contracts live in core. These aliases keep the root package as the ergonomic application-facing entry point.
type ridu.RootHooksRootHooks holds hooks for the whole application. Assign it to Config.Hooks. Its AfterError hooks see every failed operation, including failures that happen before Ridu knows which collection or global is involved.
type ridu.TypedMutationOptionsPublic authoring and runtime contracts live in core. These aliases keep the root package as the ergonomic application-facing entry point.
type ridu.UpdateUploadInputPublic authoring and runtime contracts live in core. These aliases keep the root package as the ergonomic application-facing entry point.
type ridu.UploadGrantPublic authoring and runtime contracts live in core. These aliases keep the root package as the ergonomic application-facing entry point.
type ridu.UploadGrantRequestPublic authoring and runtime contracts live in core. These aliases keep the root package as the ergonomic application-facing entry point.
type ridu.UploadImageEditPublic authoring and runtime contracts live in core. These aliases keep the root package as the ergonomic application-facing entry point.
Configuration 16
type ridu.LocalizationConfigContent locales, fallback behavior, and optional request-scoped admin availability.
type ridu.LocaleOne content locale and its ordered fallback chain.
type ridu.CollectionAdminSerializable collection presentation and editorial organization.
type ridu.LivePreviewConfigA frontend URL template and named authoring viewports.
type ridu.AuthConfigPolicy for an auth-enabled collection.
type ridu.UploadConfigValidation, privacy, and image-variant policy for an upload collection.
type ridu.VersionConfigDrafts, snapshot retention, and autosave policy.
type ridu.AdminConfigSelect the auth collection trusted to enter the framework admin.
type ridu.AdminLocalizationConfigConfigure admin interface languages and editor timezone choices.
type ridu.AdminLanguageOne statically bundled admin interface language.
type ridu.AdminTimeZoneOne timezone offered to editors.
type ridu.CollectionLabelsSingular and plural author-facing collection labels.
type ridu.CollectionIndexOne ordered compound index; Unique enforces tuple uniqueness.
type ridu.GlobalAdminSerializable singleton presentation metadata.
type ridu.DocumentLockConfigExpiration policy for coordinated authoring locks.
type ridu.PreviewBreakpointOne named live-preview viewport.
Runtime setup 12
type ridu.HandlerOptionsHTTP security, size bounds, observers, and trusted-proxy policy.
ridu.WithStore()Provide the singular document-store adapter through the Execute lifecycle.
ridu.WithProjectMigrations()Register the selected adapter’s compiled migration driver for project commands.
ridu.WithAddress()Configure the HTTP listen address independently from the store adapter.
ridu.WithUploadStorage()Provide object storage through the Execute lifecycle.
ridu.WithHandlerOptions()Configure the generated HTTP handler used by Execute.
ridu.WithServerOptions()Configure production socket and graceful-drain bounds.
type ridu.ServerOptionsSocket timeouts, graceful drain, and readiness admission.
type ridu.StoreFactoryA lazy, lifecycle-owned document-store constructor.
type ridu.StorageFactoryA lazy, lifecycle-owned object-storage constructor.
type ridu.ReadinessCheckA bounded repeatable custom readiness dependency check.
type ridu.ExecuteOptionOne opaque runtime option accepted by Execute.
Local API 14
type ridu.FindOptionsProjection, population, actor, draft, trash, and locale controls for one read.
type ridu.ListOptionsFilter, page, sort, projection, population, actor, draft, trash, and locale list controls.
type ridu.DistinctOptionsField, filter, page, actor, draft, trash, and locale controls for a unique-value read.
type ridu.ListWindowOptionsBounded unique-index range, projection, actor, and locale controls.
type ridu.MutationOptionsActor, revision, draft, response, and locale controls for one write.
type ridu.LocaleOptionsLocale selection for concise single-document calls.
type ridu.CapabilityOptionsProposed data, actor, trash, and locale input for side-effect-free access evaluation.
type ridu.AccessCapabilitiesEvaluated operation and field permission booleans.
type ridu.ImportOptionsTrusted migration identity, status, and source timestamps.
type ridu.OperationErrorThe stable code, HTTP status, message, validation issues, cause, and commit-state error returned across operation boundaries.
type ridu.LocalAPIIn-process content operations over the shared operation engine.
type ridu.OperationCapabilitiesEvaluated boolean permissions for resource operations.
type ridu.FieldCapabilitiesEvaluated read/create/update booleans for one field path.
type ridu.JoinMutationResultRefreshed source document plus applied inverse-relation delta counts.
Authentication 20
type ridu.PasswordPolicyLength, byte, bcrypt, and common-password policy for local credentials.
type ridu.PasswordResetConfigToken lifetime and trusted notification callback for password recovery.
type ridu.VerifyEmailConfigToken lifetime and trusted notification callback for email verification.
type ridu.AuthAccessRules for login, sessions, recovery, API keys, and external authentication.
type ridu.AuthContextExact actor, operation, request, and LocalAPI state for an auth rule or hook.
type ridu.AuthHooksCompiled authentication lifecycle observers.
type ridu.AuthStrategyOne compiled external request-authentication strategy.
type ridu.AuthIdentityAn exact auth collection plus actor document.
type ridu.AuthSessionA new bearer session, safe ID, typed user, and expiry.
type ridu.AuthSessionInfoSafe session/device metadata without the bearer secret.
type ridu.APIKeyA newly minted API key including its one-time secret.
type ridu.APIKeyInfoSafe metadata for listing an existing API key.
type ridu.LoginOptionsClient IP and user-agent metadata recorded with a session.
type ridu.AuthAccessRuleAllow or deny one non-CRUD authentication operation.
type ridu.AuthHookObserve or reject one authentication lifecycle phase.
type ridu.AuthOperationLogin, logout, refresh, recovery, verification, API-key, or external-auth operation.
type ridu.AuthStrategyContextNormalized headers and target collection for an external strategy.
type ridu.AuthStrategyResultWhether an external strategy recognized and authenticated a request.
type ridu.PasswordResetNotificationTrusted password-reset delivery payload including the raw one-time token.
type ridu.VerifyEmailNotificationTrusted email-verification delivery payload including the raw one-time token.
Uploads 3
type ridu.ImageSizeOne named derived image variant and fit policy.
type ridu.UploadInputStreamed file bytes, application metadata, identity, and locale.
type ridu.ReconcileResultScanned, candidate, and deleted counts from upload reconciliation.
Durable tasks 24
ridu.NewTask()Define a compiled typed durable task.
type ridu.TypedTaskA registered typed handle for durable admission, status, and cancellation.
ridu.TaskQueue()Select the queue used by a typed task.
ridu.TaskRetries()Persist retry count, delay, maximum delay, and backoff policy.
ridu.TaskTimeout()Bound one handler attempt.
ridu.TaskRetention()Keep terminal task status/output for a bounded duration.
ridu.TaskAdmissionReconciler()Repair durable domain records that missed task admission.
ridu.RetryTask()Return a retryable handler failure using configured backoff.
ridu.RetryTaskAfter()Return a retryable handler failure with an explicit delay.
ridu.AbortTask()Return a terminal handler failure.
type ridu.TaskContextCancellation, task identity, attempt number, and application access for one handler.
type ridu.TaskEnqueueOptionsRun time, queue, concurrency key, target, and requester for admission.
type ridu.TaskReceiptA typed stable handle returned by durable admission.
type ridu.TaskResultTyped task status, attempts, failure, timestamps, and optional output.
type ridu.TaskErrorA stable typed durable-task failure.
type ridu.TaskBackoffFixed, linear, or exponential durable retry schedule.
type ridu.TaskDefinitionNon-generic compiled task boundary stored in Config.Tasks.
type ridu.TaskErrorCodeStable framework task failure category.
type ridu.TaskOptionOne typed task policy option.
type ridu.TaskReconcilerBounded recovery scan for a durable task admission gap.
type ridu.TaskRunSummaryClaimed, succeeded, failed, and released counts for a worker cycle.
constant ridu.MaxTaskPayloadBytesThe maximum encoded JSON size accepted for durable task input or output.
type ridu.TaskHandlerA compiled typed durable task function.
type ridu.TaskStateQueued, running, succeeded, failed, or canceled durable state.
Access 6
type ridu.AccessDecisionAn allow, deny, or atomic document-filter decision.
type ridu.AccessRuleAuthorize one operation with actor and transaction context.
type ridu.AccessContextActor, target, locale, data, and nested API supplied to an access rule.
type ridu.CollectionAccessAccess rules for collection admin, create, read, update, delete, and unlock operations.
type ridu.GlobalAccessAllow-or-deny rules for global reads, versions, and updates.
type ridu.AccessDecisionKindAllow, deny, or filtered-decision discriminant.
Hooks 5
type ridu.HookContextRead the request and values available to a collection or global hook.
type ridu.HookRun code during a collection or global lifecycle phase.
type ridu.CollectionHooksRegister callbacks for collection or global reads, writes, and other lifecycle events.
type ridu.AfterCommitDispatcherChoose how hooks run after their transaction commits.
type ridu.AfterCommitEffectThe operation details and callback passed to an after-commit dispatcher.
Custom endpoints 3
type ridu.EndpointOne application-authored method and path handler mounted at root, collection, or global scope.
type ridu.EndpointContextRaw HTTP, route parameters, actor identity, and LocalAPI supplied to a custom endpoint.
type ridu.EndpointHandlerTrusted compiled custom endpoint handler.
Plugins 20
type ridu.PluginThe minimum stable-key contract for trusted compiled backend extensions.
type ridu.PluginDescriptorVersioned public generation, migration, and admin metadata.
type ridu.DescriptorProviderA plugin providing versioned public metadata.
type ridu.GenerationProviderA plugin contributing deterministic files from executable configuration.
type ridu.PluginGenerationContextImmutable manifest input for compiled plugin generation.
type ridu.PluginGeneratedArtifactA deterministic plugin-scoped generated file.
type ridu.ConfigTransformerA plugin transforming defensive config copies before final resolution.
type ridu.HookProviderA plugin contributing ordered collection or field hooks.
type ridu.FieldValidatorProviderA plugin validating its custom field values.
type ridu.EndpointProviderA plugin contributing namespaced REST endpoints.
type ridu.TransportProviderA plugin binding an application-level protocol transport.
type ridu.AdminPluginMetadataStatic package/export pairing for a plugin admin half.
type ridu.RiduCompatibilityHalf-open framework version range supported by a plugin.
type ridu.PluginFieldTypeGenerated Go, TypeScript, where, and OpenAPI mapping for a plugin field.
type ridu.PluginHookContributionOrdered collection or field hooks contributed by a plugin.
type ridu.PluginFieldValidationContextResolved field, concrete runtime path, and candidate value for validation.
type ridu.PluginFieldValidatorReturn path-aware issues for one plugin-owned value.
type ridu.PluginTransportContextImmutable manifest and initialized public APIs supplied during protocol binding.
constant ridu.PluginAPIVersionThe compiled backend plugin API version required by PluginDescriptor.
constant ridu.AdminPluginAPIVersionThe statically bundled admin-plugin API version required by AdminPluginMetadata.
Observability 3
type ridu.AuditEventSecurity-relevant application event metadata.
type ridu.RequestObservationCompleted request timing, route, response size, error code, and status metadata.
type ridu.RequestErrorEventTrusted internal diagnostic detail hidden from public HTTP responses.
Application contracts 1
type ridu.AppA resolved application bound to its document and optional service stores.
Runtime 1
constant ridu.FrameworkVersionThe semantic Ridu framework version used by project and CLI compatibility checks.
Constants 26
constant ridu.AccessAllowPublic constant AccessAllow from github.com/riducms/ridu.
constant ridu.AccessDenyPublic constant AccessDeny from github.com/riducms/ridu.
constant ridu.AccessWherePublic constant AccessWhere from github.com/riducms/ridu.
constant ridu.AuthOperationAPIKeyPublic constant AuthOperationAPIKey from github.com/riducms/ridu.
constant ridu.AuthOperationEmailVerificationPublic constant AuthOperationEmailVerification from github.com/riducms/ridu.
constant ridu.AuthOperationExternalStrategyPublic constant AuthOperationExternalStrategy from github.com/riducms/ridu.
constant ridu.AuthOperationLoginPublic constant AuthOperationLogin from github.com/riducms/ridu.
constant ridu.AuthOperationLogoutPublic constant AuthOperationLogout from github.com/riducms/ridu.
constant ridu.AuthOperationPasswordResetPublic constant AuthOperationPasswordReset from github.com/riducms/ridu.
constant ridu.AuthOperationRotatePublic constant AuthOperationRotate from github.com/riducms/ridu.
constant ridu.AuthOperationSessionPublic constant AuthOperationSession from github.com/riducms/ridu.
constant ridu.TaskBackoffExponentialPublic constant TaskBackoffExponential from github.com/riducms/ridu.
constant ridu.TaskBackoffFixedPublic constant TaskBackoffFixed from github.com/riducms/ridu.
constant ridu.TaskBackoffLinearPublic constant TaskBackoffLinear from github.com/riducms/ridu.
constant ridu.TaskErrorInvalidInputPublic constant TaskErrorInvalidInput from github.com/riducms/ridu.
constant ridu.TaskErrorInvalidOutputPublic constant TaskErrorInvalidOutput from github.com/riducms/ridu.
constant ridu.TaskErrorLeaseLostPublic constant TaskErrorLeaseLost from github.com/riducms/ridu.
constant ridu.TaskErrorNotFoundPublic constant TaskErrorNotFound from github.com/riducms/ridu.
constant ridu.TaskErrorNotRegisteredPublic constant TaskErrorNotRegistered from github.com/riducms/ridu.
constant ridu.TaskErrorStoreFailedPublic constant TaskErrorStoreFailed from github.com/riducms/ridu.
constant ridu.TaskErrorUnavailablePublic constant TaskErrorUnavailable from github.com/riducms/ridu.
constant ridu.TaskStateCanceledPublic constant TaskStateCanceled from github.com/riducms/ridu.
constant ridu.TaskStateFailedPublic constant TaskStateFailed from github.com/riducms/ridu.
constant ridu.TaskStateQueuedPublic constant TaskStateQueued from github.com/riducms/ridu.
constant ridu.TaskStateRunningPublic constant TaskStateRunning from github.com/riducms/ridu.
constant ridu.TaskStateSucceededPublic constant TaskStateSucceeded from github.com/riducms/ridu.