config

package
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package config validates and normalizes the public authoring model into a canonical immutable schema manifest.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Resolve

func Resolve(input Input) (schema.Manifest, error)

Resolve performs a complete deterministic validation pass before freezing a manifest. It has no runtime plugin setup, database, filesystem, or network dependency.

Types

type Admin

type Admin struct {
	User         schema.CollectionSlug
	Localization AdminLocalization
}

type AdminLanguage

type AdminLanguage struct {
	Code              string
	Label             string
	LabelTranslations map[string]string
	RTL               bool
}

type AdminLocalization

type AdminLocalization struct {
	Languages       []AdminLanguage
	DefaultLanguage string
	TimeZones       []AdminTimeZone
	DefaultTimeZone string
}

type AdminTimeZone

type AdminTimeZone struct {
	ID                string
	Label             string
	LabelTranslations map[string]string
}

type Collection

type Collection struct {
	Slug                 schema.CollectionSlug
	Labels               schema.CollectionLabels
	Admin                CollectionAdmin
	Fields               []field.Definition
	Indexes              []CollectionIndex
	Auth                 bool
	SessionDuration      time.Duration
	PasswordMinLength    int
	PasswordMaxBytes     int
	PasswordBcryptCost   int
	MaxLoginAttempts     int
	LockDuration         time.Duration
	PasswordReset        bool
	PasswordResetTTL     time.Duration
	VerifyEmail          bool
	VerificationTTL      time.Duration
	APIKeys              bool
	Upload               bool
	UploadConfig         UploadConfig
	Versions             bool
	Trash                bool
	LockDocuments        bool
	DocumentLockDuration time.Duration
	VersionConfig        VersionConfig
	Endpoints            []Endpoint
}

type CollectionAdmin

type CollectionAdmin struct {
	UseAsTitle              string
	DefaultColumns          []string
	Group                   string
	GroupTranslations       map[string]string
	Description             string
	DescriptionTranslations map[string]string
	FolderField             string
	ParentField             string
	LivePreview             LivePreviewConfig
}

type CollectionIndex

type CollectionIndex struct {
	Fields []string
	Unique bool
}

type Endpoint

type Endpoint struct {
	Method  string
	Path    string
	Summary string
}

type Global

type Global struct {
	Slug              schema.CollectionSlug
	Label             string
	LabelTranslations map[string]string
	Admin             GlobalAdmin
	Fields            []field.Definition
	Versions          bool
	VersionConfig     VersionConfig
	Endpoints         []Endpoint
}

type GlobalAdmin

type GlobalAdmin struct {
	Group                   string
	GroupTranslations       map[string]string
	Description             string
	DescriptionTranslations map[string]string
	LivePreview             LivePreviewConfig
}

type ImageSize

type ImageSize struct {
	Name   string
	Width  int
	Height int
	Fit    string
}

type Input

type Input struct {
	Name             string
	NameTranslations map[string]string
	AllowIDOnCreate  bool
	Admin            Admin
	Localization     *Localization
	Collections      []Collection
	Globals          []Global
	Endpoints        []Endpoint
	Plugins          []Plugin
}

type LivePreviewConfig

type LivePreviewConfig struct {
	URL         string
	Breakpoints []PreviewBreakpoint
}

type Locale

type Locale struct {
	Code            schema.LocaleCode
	Label           string
	RTL             bool
	FallbackLocales []schema.LocaleCode
}

type Localization

type Localization struct {
	Locales         []Locale
	DefaultLocale   schema.LocaleCode
	DisableFallback bool
}

type Plugin

type Plugin struct {
	Key                   string
	Version               string
	GoPackage             string
	APIVersion            uint32
	Ridu                  *PluginCompatibility
	Admin                 *PluginAdmin
	FieldTypes            []PluginFieldType
	DatabaseContributions []PluginDatabaseContribution
	Endpoints             []PluginEndpoint
}

type PluginAdmin

type PluginAdmin struct {
	Package        string
	Export         string
	APIVersion     uint32
	PairingVersion uint32
	Routes         []string
	Assets         []string
}

type PluginCompatibility

type PluginCompatibility struct {
	Minimum          string
	MaximumExclusive string
}

type PluginDatabaseContribution

type PluginDatabaseContribution struct {
	Adapter    schema.PluginDatabaseAdapter
	Migrations []PluginMigration
	Tables     []string
}

type PluginEndpoint

type PluginEndpoint struct {
	Method  string
	Path    string
	Summary string
}

type PluginFieldType

type PluginFieldType struct {
	Key               string
	TypeScriptPackage string
	TypeScriptOutput  string
	TypeScriptInput   string
	TypeScriptWhere   string
	GoPackage         string
	GoType            string
	JSONSchema        []byte
}

type PluginMigration

type PluginMigration struct {
	Version uint32
	Name    string
	UpSQL   []string
	DownSQL []string
}

type PreviewBreakpoint

type PreviewBreakpoint struct {
	Name              string
	Label             string
	LabelTranslations map[string]string
	Width             int
	Height            int
}

type UploadConfig

type UploadConfig struct {
	MaxFileSize int64
	MimeTypes   []string
	Private     bool
	ImageSizes  []ImageSize
}

type VersionConfig

type VersionConfig struct {
	Drafts           bool
	MaxPerDocument   int
	AutosaveInterval time.Duration
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL