Module
core
github.com/riducms/ridu/core — Application settings and server APIs, also available from the root ridu package.
Types 27
type core.CollectionHooksCollectionHooks configures resource-level callbacks through Collection.Hooks or Global.Hooks. Use BeforeChange to change values before a save, AfterRead to change a response without changing storage, and AfterCommit for effects that must run only after a successful commit. Each list runs in declaration order. Resource hooks run before field hooks in the same phase, except AfterCommit, where field hooks run first. Globals do not support BeforeDuplicate, BeforeDelete, or AfterDelete.
type core.HookContextHookContext supplies the request, values, and local API to a collection or global hook. Change entries in Data before saving, or values in Document to change the response after saving. A Hook returns only an error.
type core.PluginDescriptorPluginDescriptor is deterministic public metadata for one compiled plugin. It is copied into the canonical manifest so generators, migration planning, the admin build, and compatibility tooling all inspect the same declaration. Executable hooks, handlers, validators, and secrets never belong here.
type core.AdminConfigApplication-level configuration for the framework-owned admin.
type core.AdminLocalizationConfigAdmin interface languages and editor timezone choices.
type core.AdminLanguageOne statically bundled admin interface language.
type core.AdminTimeZoneOne timezone offered by the admin interface.
type core.CollectionLabelsAuthor-facing singular and plural collection names.
type core.CollectionIndexOne ordered compound database index.
type core.GlobalAdminSerializable presentation metadata for a global.
type core.ConfigExecutable application-owned Ridu configuration.
type core.LocalizationConfigApplication content-locale configuration.
type core.LocaleAvailabilityDynamically limit content locales shown to one author.
type core.LocaleAvailabilityContextRequest input for dynamic admin locale visibility.
type core.LocaleOne content locale and its ordered fallback chain.
type core.CollectionCollection defines one document collection in authoring configuration.
type core.CollectionAdminSerializable collection presentation metadata.
type core.GlobalGlobal defines one singleton document in authoring configuration.
type core.VersionConfigRevision and draft behavior for a versioned resource.
type core.AdminLoadContextRead content for the signed-in user while a Go admin loader runs.
type core.AdminLoaderDefinitionA Go admin loader ready to register in your application's Admin.Loaders.
type core.BulkOptionsBulkOptions controls the actor and localization of an atomic batch or empty-trash operation. Bulk actions do not consume per-document revisions, population, draft status, or caller IDs.
type core.FieldGraphContextFieldGraphContext identifies the resource a graph plugin is editing. Resource transforms complete first; graph transforms then run once in Plugins order. Resource hooks, endpoints and domain capabilities retain their own contracts.
type core.PublicationScheduleOptionsPublicationScheduleOptions controls revision fencing and the saved display timezone. TimeZone is optional; it never changes the instant supplied in runAt.
type core.TypedReadOptionsTypedReadOptions controls population/projection without changing the generated definition's single-locale or all-locales output shape.
type core.UploadGrantUploadGrant is a short-lived delivery URL for one upload object. The URL authorizes that object without carrying the session token.
type core.UploadGrantRequestUploadGrantRequest names one upload document and an optional configured image size. An empty Size selects the original object.
Runtime 41
constant core.FrameworkVersiontype core.Apptype core.LocalAPIApp.RunTasks()type core.ReadinessChecktype core.AuditEventtype core.RequestObservationtype core.RequestErrorEventtype core.TaskBackofftype core.TaskHandlertype core.TaskReconcilertype core.TaskContexttype core.TaskOptiontype core.TaskEnqueueOptionstype core.TaskReceipttype core.TaskResulttype core.TaskErrorCodetype core.TaskErrortype core.TaskRunSummarytype core.TypedTasktype core.HandlerOptionstype core.ServerOptionstype core.StoreFactorytype core.StorageFactorytype core.ExecuteOptioncore.WithUploadStorage()core.WithStore()core.WithProjectMigrations()core.WithAddress()core.WithHandlerOptions()core.WithServerOptions()core.Execute()core.TaskQueue()core.TaskRetries()core.TaskTimeout()core.TaskRetention()core.TaskAdmissionReconciler()core.NewTask()core.RetryTask()core.RetryTaskAfter()core.AbortTask()
Application 6
constant core.MaxTaskPayloadBytesThe maximum encoded JSON size accepted for durable task input or output.
App.Manifest()App.Local()App.Handler()core.Resolve()Resolve executable config into the immutable canonical schema manifest.
core.New()Resolve an application and bind it to an already-open document store.
Local API 7
LocalAPI.List()LocalAPI.Distinct()LocalAPI.ListWindow()LocalAPI.Capabilities()LocalAPI.CopyGlobalLocale()type core.OperationErrorStructured operation-boundary failure.
type core.JoinMutationResultResult of one atomic inverse-relationship mutation.
Local API options 9
type core.LocaleOptionsLocale selection for one single-document Local API operation.
type core.FindOptionsProjection, population, authorization, draft, trash, and locale controls for one read.
type core.ListOptionsFiltering, pagination, projection, population, authorization, and locale controls for a list read.
type core.DistinctOptionsField, filtering, pagination, authorization, draft, trash, and locale controls for one unique-value read.
type core.ListWindowOptionsA count-free bounded unique-index range for background work.
type core.MutationOptionsAuthorization, optimistic concurrency, response population, create status, and locale controls for one write.
type core.CapabilityOptionsSide-effect-free access evaluation input.
type core.AccessCapabilitiesEvaluated operation and per-field permission booleans.
type core.ImportOptionsMigration-owned source identity, status, and timestamps.
Authentication 47
type core.AuthIdentitytype core.AuthSessiontype core.LoginOptionsApp.AuthInitialized()App.AuthBootstrapAvailable()App.Login()App.Session()App.RotateSession()App.Sessions()App.RevokeSession()App.Logout()App.LogoutAll()App.ChangePassword()App.RequestPasswordReset()App.ResetPassword()App.RequestVerification()App.VerifyEmail()App.CreateAPIKey()App.AuthenticateAPIKeyIdentity()App.AuthenticateExternalIdentity()App.APIKeys()App.RevokeAPIKey()App.AuthenticateAPIKey()App.PruneExpiredAuth()App.SetPassword()App.LoginWithOptions()App.AuthenticateExternal()App.ForceUnlock()App.UnlockAuthUser()type core.PasswordPolicytype core.PasswordResetConfigtype core.VerifyEmailConfigtype core.PasswordResetNotificationtype core.VerifyEmailNotificationtype core.AuthAccesstype core.AuthContexttype core.AuthHookstype core.AuthStrategytype core.AuthStrategyContexttype core.AuthStrategyResulttype core.AuthAccessRuletype core.AuthHooktype core.AuthOperationtype core.AuthSessionInfotype core.APIKeytype core.APIKeyInfotype core.AuthConfig
Uploads 18
type core.UploadInputFile bytes and application-owned metadata for one upload.
type core.RemoteUploadInputA public HTTP(S) asset and upload metadata.
App.Upload()App.UploadFromURL()App.OpenUploadWithOptions()App.UpdateUpload()App.ReconcileUploads()App.UploadForIdentity()App.UploadFromURLForIdentity()App.UpdateUploadForIdentity()App.OpenUpload()App.OpenUploadForIdentity()App.CleanupUploads()type core.ImageSizeOne named derived image variant and fit policy.
type core.ReconcileResultResult counters from upload reconciliation.
type core.UploadConfigValidation and object-storage behavior for an upload collection.
type core.UpdateUploadInputAtomic upload replacement, image edit, document data, and publishing input.
type core.UploadImageEditA reversible crop and focal point on the oriented source image.
Publishing 4
Document locks 5
type core.DocumentLockStateSafe current lock metadata and actor capabilities.
App.DocumentLock()App.AcquireDocumentLock()App.ReleaseDocumentLock()type core.DocumentLockConfigExpiration policy for coordinated authoring locks.
Live preview 8
type core.PreviewTokenOne short-lived read-only resource capability.
App.CreateCollectionPreviewToken()App.FindCollectionPreview()App.CreateGlobalPreviewToken()App.FindGlobalPreview()App.RevokePreviewToken()type core.PreviewBreakpointOne named authoring viewport offered by live preview.
type core.LivePreviewConfigSerializable same- or cross-origin editor preview configuration.
Preferences 4
Generated Go API 21
type core.InputA presence-aware value used by nullable generated Go mutation fields.
core.Set()Construct a present generated mutation field with a concrete value.
core.Null()Construct a present generated mutation field whose JSON value is null.
type core.NonNullInputA write-only generated mutation value that refuses to encode JSON null.
core.NonNull()Construct a required generated mutation value that must not encode as JSON null.
core.SetNonNull()Construct a present omittable generated mutation value that must not encode as JSON null.
core.NewTypedCollection()Create a generated-model handle for one collection slug.
type core.TypedCollectionAn unbound typed collection descriptor.
type core.BoundTypedCollectionTyped collection methods for strict writes, incomplete working drafts, publication, reads, and deletion.
type core.TypedPageA typed list result with the ordinary page metadata.
type core.TypedListOptionsFilter, paginate, populate and project generated documents without changing the binding’s locale shape.
type core.TypedMutationOptionsActor, draft intent, expected revision, locale, and response controls for a generated Go mutation.
core.NewTypedGlobal()Create a generated-model handle for one global slug.
type core.BoundTypedGlobalTyped singleton methods for reads, working drafts, publication, restoration, and discard.
type core.TypedGlobalGenerated typed definition for one global.
BoundTypedCollection.CreateDraft()BoundTypedCollection.SaveDraft()type core.BoundTypedAllLocalesCollectionTyped Find and List reads with population, projection and all translations.
type core.BoundTypedAllLocalesGlobalA typed global read with population, projection and all translations.
type core.TypedAllLocalesCollectionA collection read descriptor for generated all-locales document models.
type core.TypedAllLocalesGlobalA global read descriptor for generated all-locales document models.
Access 9
type core.AccessDecisionAn allow, deny, or filtered authorization result.
type core.CollectionAccessAccess rules for collection reads and mutations.
type core.GlobalAccessAccess rules for reading, updating, publishing, and unpublishing a global.
type core.AccessRuleReturn an authorization decision for one operation.
type core.AccessContextIdentity, operation, locale, and request data for an access rule.
type core.AccessDecisionKindAllow, deny, or filtered access-decision discriminant.
core.Allow()Authorize an operation without a document predicate.
core.Deny()Reject an operation.
core.Where()Authorize only documents matching an atomic predicate.
Hooks 4
type core.HookRun code during a collection or global lifecycle phase.
type core.RootHooksApplication-wide failure hooks for errors raised before a resource resolves.
interface core.AfterCommitDispatcherChoose how hooks run after their transaction commits.
type core.AfterCommitEffectThe operation details and callback passed to an after-commit dispatcher.
Interfaces 5
interface core.PluginThe minimum compiled backend plugin contract.
interface core.DescriptorProviderOpt into versioned generation, migration, and compatibility tooling.
interface core.TaskDefinitionNon-generic compiled task boundary stored in Config.Tasks.
interface core.FieldGraphTransformerFieldGraphTransformer edits immutable fields through public graph operations. The input and result are snapshotted. Plugins should return deterministic edits; closure captures and other plugin-owned external state remain their responsibility. Duplicate plugin keys are rejected before any transform runs.
interface core.FieldGraphValidatorFieldGraphValidator checks a resource's final immutable field configuration after every graph transformer has completed. It cannot publish graph edits. Use this for plugin-owned schema and host settings, not document validation; runtime value validators belong to the field or plugin value contract.
Capabilities 10
interface core.GenerationProviderContribute deterministic files that require executable plugin configuration.
type core.PluginGenerationContextImmutable schema state supplied to plugin generation.
type core.PluginGeneratedArtifactOne deterministic plugin-scoped generated file.
interface core.ConfigTransformerTransform a defensive copy of authored config before final validation.
interface core.HookProviderAppend compiled collection or field hooks.
interface core.FieldValidatorProviderProvide path-aware runtime validators for plugin field keys.
interface core.EndpointProviderContribute exact REST endpoints below a namespaced plugin prefix.
interface core.TransportProviderBind an established application-level protocol once at startup.
type core.OperationCapabilitiesNon-secret permission summary for resource operations.
type core.FieldCapabilitiesEvaluated permissions for one authored field path.
Custom endpoints 3
type core.EndpointOne application-authored method and path handler mounted at root, collection, or global scope.
type core.EndpointContextRaw HTTP, route parameters, verified actor identity, and LocalAPI supplied to a custom endpoint.
type core.EndpointHandlerTrusted compiled custom endpoint handler.
Descriptors 9
constant core.PluginAPIVersionThe compiled backend plugin contract version supported by this Ridu release.
constant core.AdminPluginAPIVersionThe statically bundled admin-plugin contract version supported by this Ridu release.
type core.RiduCompatibilityA half-open supported framework semantic-version interval.
type core.AdminPluginMetadataStatic pairing metadata for a plugin admin package.
type core.PluginFieldTypeExact generated Go, TypeScript, where, and OpenAPI types for a plugin field.
type core.PluginHookContributionOrdered collection or field hooks contributed by a plugin.
type core.PluginFieldValidationContextResolved plugin field and candidate value supplied to validation.
type core.PluginFieldValidatorReturn path-aware issues for one plugin-owned value.
type core.PluginTransportContextInitialized application state supplied while a plugin binds transports.
Constants 26
constant core.AccessAllowPublic constant AccessAllow from github.com/riducms/ridu/core.
constant core.AccessDenyPublic constant AccessDeny from github.com/riducms/ridu/core.
constant core.AccessWherePublic constant AccessWhere from github.com/riducms/ridu/core.
constant core.AuthOperationAPIKeyPublic constant AuthOperationAPIKey from github.com/riducms/ridu/core.
constant core.AuthOperationEmailVerificationPublic constant AuthOperationEmailVerification from github.com/riducms/ridu/core.
constant core.AuthOperationExternalStrategyPublic constant AuthOperationExternalStrategy from github.com/riducms/ridu/core.
constant core.AuthOperationForgotPasswordPublic constant AuthOperationForgotPassword from github.com/riducms/ridu/core.
constant core.AuthOperationLoginPublic constant AuthOperationLogin from github.com/riducms/ridu/core.
constant core.AuthOperationLogoutPublic constant AuthOperationLogout from github.com/riducms/ridu/core.
constant core.AuthOperationMePublic constant AuthOperationMe from github.com/riducms/ridu/core.
constant core.AuthOperationPasswordResetPublic constant AuthOperationPasswordReset from github.com/riducms/ridu/core.
constant core.AuthOperationRotatePublic constant AuthOperationRotate from github.com/riducms/ridu/core.
constant core.AuthOperationSessionPublic constant AuthOperationSession from github.com/riducms/ridu/core.
constant core.TaskBackoffExponentialPublic constant TaskBackoffExponential from github.com/riducms/ridu/core.
constant core.TaskBackoffFixedPublic constant TaskBackoffFixed from github.com/riducms/ridu/core.
constant core.TaskBackoffLinearPublic constant TaskBackoffLinear from github.com/riducms/ridu/core.
constant core.TaskErrorInvalidInputPublic constant TaskErrorInvalidInput from github.com/riducms/ridu/core.
constant core.TaskErrorInvalidOutputPublic constant TaskErrorInvalidOutput from github.com/riducms/ridu/core.
constant core.TaskErrorLeaseLostPublic constant TaskErrorLeaseLost from github.com/riducms/ridu/core.
constant core.TaskErrorNotFoundPublic constant TaskErrorNotFound from github.com/riducms/ridu/core.
constant core.TaskErrorNotRegisteredPublic constant TaskErrorNotRegistered from github.com/riducms/ridu/core.
constant core.TaskErrorStoreFailedPublic constant TaskErrorStoreFailed from github.com/riducms/ridu/core.
constant core.TaskErrorUnavailablePublic constant TaskErrorUnavailable from github.com/riducms/ridu/core.
constant core.DefaultUploadGrantLifetimeDefaultUploadGrantLifetime is used when a grant request omits a lifetime.
constant core.MaxUploadGrantLifetimeMaxUploadGrantLifetime bounds how long a leaked delivery URL stays usable.
constant core.MaxUploadGrantsPerRequestMaxUploadGrantsPerRequest bounds one grant request.
Methods 97
LocalAPI.Create()LocalAPI.Duplicate()LocalAPI.Find()LocalAPI.Update()LocalAPI.Delete()LocalAPI.RestoreDeleted()LocalAPI.DeletePermanent()LocalAPI.Publish()LocalAPI.PublishChanges()LocalAPI.Unpublish()LocalAPI.Versions()LocalAPI.Version()LocalAPI.Restore()LocalAPI.RestoreAsDraft()LocalAPI.Import()LocalAPI.MutateJoin()LocalAPI.CopyLocale()LocalAPI.BulkUpdate()LocalAPI.BulkPublish()LocalAPI.BulkUnpublish()LocalAPI.BulkDelete()LocalAPI.BulkRestoreDeleted()LocalAPI.BulkDeletePermanent()LocalAPI.EmptyTrash()LocalAPI.Global()LocalAPI.UpdateGlobal()LocalAPI.PublishGlobal()LocalAPI.PublishGlobalChanges()LocalAPI.UnpublishGlobal()LocalAPI.GlobalVersion()LocalAPI.RestoreGlobal()LocalAPI.RestoreGlobalAsDraft()LocalAPI.GlobalVersions()App.CreateAuthUser()App.CreateAuthUserForTransport()App.Duplicate()App.DuplicateForIdentity()AccessDecision.Filter()AccessDecision.Kind()BoundTypedCollection.Create()BoundTypedCollection.Delete()BoundTypedCollection.DiscardDraft()BoundTypedCollection.Find()BoundTypedCollection.Import()BoundTypedCollection.List()BoundTypedCollection.Publish()BoundTypedCollection.PublishChanges()BoundTypedCollection.Unpublish()BoundTypedCollection.Update()BoundTypedGlobal.DiscardDraft()BoundTypedGlobal.Find()BoundTypedGlobal.Publish()BoundTypedGlobal.PublishChanges()BoundTypedGlobal.Restore()BoundTypedGlobal.RestoreAsDraft()BoundTypedGlobal.SaveDraft()BoundTypedGlobal.Unpublish()BoundTypedGlobal.Update()Input.MarshalJSON()NonNullInput.MarshalJSON()TaskError.Error()TaskError.Unwrap()TypedCollection.Slug()TypedCollection.With()TypedGlobal.Slug()TypedGlobal.With()TypedTask.Cancel()TypedTask.Enqueue()TypedTask.Result()TypedTask.TaskSlug()AdminLoadContext.Actor()AdminLoadContext.ActorCollection()AdminLoadContext.Find()AdminLoadContext.Global()AdminLoadContext.List()AdminLoadContext.Locale()AdminLoadContext.Manifest()App.CreateUploadGrants()App.OpenUploadSourceForIdentity()App.OpenUploadWithGrant()App.PreviewUploadForIdentity()App.ScheduleUnpublish()BoundTypedAllLocalesCollection.Find()BoundTypedAllLocalesCollection.List()BoundTypedAllLocalesGlobal.Find()HookContext.Candidate()Input.Get()Input.UnmarshalJSON()LocalAPI.CountGlobalVersions()LocalAPI.CountVersions()LocalAPI.DiscardDraft()LocalAPI.DiscardGlobalDraft()LocalAPI.ListJoin()NonNullInput.Get()NonNullInput.UnmarshalJSON()TypedAllLocalesCollection.With()TypedAllLocalesGlobal.With()
Functions 4
core.NewAdminLoader()Define a Go read function whose result is supplied to an admin component.
core.NewTypedAllLocalesCollection()NewTypedAllLocalesCollection constructs an all-locales generated read definition.
core.NewTypedAllLocalesGlobal()NewTypedAllLocalesGlobal constructs an all-locales generated global definition.
core.Reject()Reject stops an operation from a collection, global, or field hook with a message for the person who made the request. The admin shows the message, and REST, the SDK, and the Local API return it as a "rejected" error (HTTP 422). Any other error from a hook is reported as an internal failure whose message stays on the server.