type
Collection
type Collection = core.CollectionA repeatable model with fields, access, hooks, and capabilities.
Slugschema.CollectionSlug- URL-safe identity used by APIs, relationships, and the admin.
LabelsCollectionLabels- Overrides singular and plural author-facing names.
AdminCollectionAdmin- Configures presentation and editorial organization.
Fields[]field.Definition- Declares stored values and admin presentation.
Indexes[]CollectionIndex- Declares ordered compound indexes.
Authbool- Enables identities, passwords, and sessions.
AuthConfigAuthConfig- Customizes behavior for an auth-enabled collection.
Uploadbool- Enables file metadata and object-storage behavior.
UploadConfigUploadConfig- Configures upload validation, privacy, and image variants.
Versionsbool- Enables document revision history.
Trashbool- Keeps deleted documents recoverable until permanent deletion.
LockDocumentsbool- Coordinates exclusive document editing.
DocumentLockConfigDocumentLockConfig- Customizes active lock expiry.
VersionConfigVersionConfig- Customizes drafts, retention, and autosave.
AccessCollectionAccess- Defines operation-level authorization.
FieldAccessmap[string]FieldAccess- Defines field-path read and write authorization.
FieldHooksmap[string]CollectionHooks- Defines lifecycle hooks scoped to field paths.
HooksCollectionHooks- Defines collection-wide lifecycle behavior.
Computedmap[string]Computed- Resolves virtual fields after an operation produces a document.
Endpoints[]Endpoint- Declares collection-scoped custom HTTP endpoints.
Example
var Posts = ridu.Collection{
Slug: "posts",
Fields: []field.Definition{
field.Text("title", field.Required()),
},
}