Versions in this module Expand all Collapse all v0 v0.0.16 Feb 11, 2026 v0.0.15 Feb 11, 2026 Changes in this version + const DefaultAppSettingsSchemaID + const DefaultAppSettingsSchemaName + const SectionIDAuthentication + const SectionIDBranding + const SectionIDGeneral + const SectionIDNotification + const SectionIDSecurity + const SectionIDSession + var ErrDuplicateFieldID = &SchemaError + var ErrDuplicateSectionID = &SchemaError + var ErrFieldNotFound = &SchemaError + var ErrInvalidFieldType = &SchemaError + var ErrSchemaNotFound = &SchemaError + var ErrSectionNotFound = &SchemaError + func RegisterDefaultSections() error + func RegisterProvider(provider SettingsProvider) error + func RegisterSection(section *Section) error + type AsyncValidator interface + Name func() string + ValidateAsync func(ctx context.Context, fieldID string, value any) error + func CompositeAsyncValidator(validators ...AsyncValidator) AsyncValidator + func ConditionalAsyncValidator(condition func(ctx context.Context, fieldID string, value any) bool, ...) AsyncValidator + func CustomAsyncValidator(name string, message string, ...) AsyncValidator + func ExistsValidator(checkFn func(ctx context.Context, value any) (bool, error), entityName string) AsyncValidator + func ExternalAPIValidator(checkURL string, timeout time.Duration) AsyncValidator + func NewAsyncValidator(name string, fn func(ctx context.Context, fieldID string, value any) error) AsyncValidator + func NotExistsValidator(checkFn func(ctx context.Context, value any) (bool, error), message string) AsyncValidator + func ParallelAsyncValidator(validators ...AsyncValidator) AsyncValidator + func RateLimitedValidator(validator AsyncValidator, maxRequests int, window time.Duration) AsyncValidator + func RetryValidator(validator AsyncValidator, maxRetries int, backoff time.Duration) AsyncValidator + func TimeoutValidator(validator AsyncValidator, timeout time.Duration) AsyncValidator + func UniqueValidator(checkFn UniqueCheckFunc) AsyncValidator + func UniqueValidatorWithMessage(checkFn UniqueCheckFunc, message string) AsyncValidator + type AsyncValidatorConfig struct + Message string + Params map[string]any + Type string + type AsyncValidatorFunc struct + func (v AsyncValidatorFunc) Name() string + func (v AsyncValidatorFunc) ValidateAsync(ctx context.Context, fieldID string, value any) error + type CachedAsyncValidator struct + func NewCachedAsyncValidator(validator AsyncValidator, ttl time.Duration) *CachedAsyncValidator + func (c *CachedAsyncValidator) Name() string + func (c *CachedAsyncValidator) ValidateAsync(ctx context.Context, fieldID string, value any) error + type Condition struct + Action ConditionAction + Field string + Operator ConditionOperator + Value any + type ConditionAction string + const ActionDisable + const ActionEnable + const ActionHide + const ActionRequire + const ActionShow + type ConditionOperator string + const ConditionContains + const ConditionEmpty + const ConditionEquals + const ConditionGreaterThan + const ConditionLessThan + const ConditionNotEmpty + const ConditionNotEquals + type DynamicSettingsProvider interface + GetDynamicSections func(ctx context.Context, appID string) ([]*Section, error) + type Field struct + AsyncValidatorConfigs []AsyncValidatorConfig + AsyncValidators []AsyncValidator + Conditions []Condition + DefaultValue any + Description string + Disabled bool + HelpText string + Hidden bool + ID string + Label string + Max *float64 + MaxLength *int + Metadata map[string]any + Min *float64 + MinLength *int + Options []SelectOption + Order int + Pattern string + PatternMessage string + Placeholder string + Prefix string + ReadOnly bool + Required bool + Step *float64 + Suffix string + Type FieldType + ValidatorConfigs []ValidatorConfig + Validators []Validator + Width string + func (f *Field) Clone() *Field + func (f *Field) GetDefaultValue() any + type FieldBuilder struct + func NewField(id string, fieldType FieldType) *FieldBuilder + func (b *FieldBuilder) Build() *Field + func (b *FieldBuilder) Condition(cond Condition) *FieldBuilder + func (b *FieldBuilder) DefaultValue(value any) *FieldBuilder + func (b *FieldBuilder) DependsOn(fieldID string, value any) *FieldBuilder + func (b *FieldBuilder) Description(desc string) *FieldBuilder + func (b *FieldBuilder) Disabled() *FieldBuilder + func (b *FieldBuilder) HelpText(text string) *FieldBuilder + func (b *FieldBuilder) Hidden() *FieldBuilder + func (b *FieldBuilder) HideWhen(fieldID string, value any) *FieldBuilder + func (b *FieldBuilder) Label(label string) *FieldBuilder + func (b *FieldBuilder) LabeledOptions(pairs ...string) *FieldBuilder + func (b *FieldBuilder) Max(max float64) *FieldBuilder + func (b *FieldBuilder) MaxLength(max int) *FieldBuilder + func (b *FieldBuilder) Min(min float64) *FieldBuilder + func (b *FieldBuilder) MinLength(min int) *FieldBuilder + func (b *FieldBuilder) Options(options ...SelectOption) *FieldBuilder + func (b *FieldBuilder) Order(order int) *FieldBuilder + func (b *FieldBuilder) Pattern(pattern, message string) *FieldBuilder + func (b *FieldBuilder) Placeholder(placeholder string) *FieldBuilder + func (b *FieldBuilder) Prefix(prefix string) *FieldBuilder + func (b *FieldBuilder) ReadOnly() *FieldBuilder + func (b *FieldBuilder) RequireWhen(fieldID string, value any) *FieldBuilder + func (b *FieldBuilder) Required() *FieldBuilder + func (b *FieldBuilder) Step(step float64) *FieldBuilder + func (b *FieldBuilder) StringOptions(values ...string) *FieldBuilder + func (b *FieldBuilder) Suffix(suffix string) *FieldBuilder + func (b *FieldBuilder) Width(width string) *FieldBuilder + func (b *FieldBuilder) WithAsyncValidator(v AsyncValidator) *FieldBuilder + func (b *FieldBuilder) WithMetadata(key string, value any) *FieldBuilder + func (b *FieldBuilder) WithValidator(v Validator) *FieldBuilder + type FieldType string + const FieldTypeBoolean + const FieldTypeColor + const FieldTypeDate + const FieldTypeDateTime + const FieldTypeEmail + const FieldTypeFile + const FieldTypeJSON + const FieldTypeMultiSelect + const FieldTypeNumber + const FieldTypePassword + const FieldTypeSelect + const FieldTypeSlider + const FieldTypeTags + const FieldTypeText + const FieldTypeTextArea + const FieldTypeURL + func (ft FieldType) IsValid() bool + func (ft FieldType) String() string + type Registry struct + func Global() *Registry + func NewRegistry() *Registry + func (r *Registry) Clear() + func (r *Registry) Clone() *Registry + func (r *Registry) GetDefaults() map[string]map[string]any + func (r *Registry) GetDynamicSchema(ctx context.Context, appID, schemaID, schemaName string) (*Schema, error) + func (r *Registry) GetProvider(providerID string) SettingsProvider + func (r *Registry) GetSchema(schemaID, schemaName string) *Schema + func (r *Registry) GetSection(sectionID string) *Section + func (r *Registry) GetSectionDefaults(sectionID string) map[string]any + func (r *Registry) GetSortedSections() []*Section + func (r *Registry) ListProviders() []SettingsProvider + func (r *Registry) ListSections() []*Section + func (r *Registry) MergeWithDefaults(data map[string]map[string]any) map[string]map[string]any + func (r *Registry) RegisterProvider(provider SettingsProvider) error + func (r *Registry) RegisterSection(section *Section) error + func (r *Registry) RegisterSections(sections ...*Section) error + func (r *Registry) Stats() RegistryStats + func (r *Registry) UnregisterProvider(providerID string) + func (r *Registry) UnregisterSection(sectionID string) + func (r *Registry) ValidateSchema(ctx context.Context, data map[string]map[string]any) *ValidationResult + func (r *Registry) ValidateSection(ctx context.Context, sectionID string, data map[string]any) *ValidationResult + func (r *Registry) ValidateWithProviders(ctx context.Context, appID, sectionID string, data map[string]any) *ValidationResult + type RegistryStats struct + FieldCount int + ProviderCount int + SectionCount int + type RenderOption func(*renderOptions) + func WithReadOnly() RenderOption + func WithSaveButton() RenderOption + type Renderer struct + func NewRenderer() *Renderer + func (r *Renderer) RenderField(field *Field, options ...RenderOption) g.Node + func (r *Renderer) RenderSchema(schema *Schema, options ...RenderOption) g.Node + func (r *Renderer) RenderSection(section *Section, options ...RenderOption) g.Node + func (r *Renderer) WithDataPrefix(prefix string) *Renderer + func (r *Renderer) WithErrorPrefix(prefix string) *Renderer + func (r *Renderer) WithOnSave(fn string) *Renderer + func (r *Renderer) WithTheme(theme string) *Renderer + type Schema struct + Description string + ID string + Metadata map[string]any + Name string + Sections []*Section + Version int + func DefaultAppSettingsSchema() *Schema + func FromJSON(data []byte) (*Schema, error) + func GetGlobalSchema(schemaID, schemaName string) *Schema + func NewSchema(id, name string) *Schema + func (s *Schema) AddSection(section *Section) *Schema + func (s *Schema) Clone() *Schema + func (s *Schema) GetDefaults() map[string]map[string]any + func (s *Schema) GetField(sectionID, fieldID string) *Field + func (s *Schema) GetSection(sectionID string) *Section + func (s *Schema) ToJSON() ([]byte, error) + type SchemaError struct + Details string + Message string + Type string + func NewSchemaError(errType, message, details string) *SchemaError + func (e *SchemaError) Error() string + type Section struct + Collapsible bool + DefaultCollapsed bool + Description string + Fields []*Field + HelpURL string + ID string + Icon string + Metadata map[string]any + Order int + Permissions []string + ReadOnly bool + Title string + func AuthenticationSettingsSection() *Section + func BrandingSettingsSection() *Section + func GeneralSettingsSection() *Section + func GetGlobalSection(sectionID string) *Section + func NewSection(id, title string) *Section + func NotificationSettingsSection() *Section + func SecuritySettingsSection() *Section + func SessionSettingsSection() *Section + func (s *Section) AddField(field *Field) *Section + func (s *Section) AddFields(fields ...*Field) *Section + func (s *Section) Clone() *Section + func (s *Section) ExtractData(data map[string]any) map[string]any + func (s *Section) GetDefaults() map[string]any + func (s *Section) GetField(fieldID string) *Field + func (s *Section) GetSortedFields() []*Field + func (s *Section) Patch(existing, patch map[string]any) (map[string]any, error) + func (s *Section) Validate(ctx context.Context, data map[string]any) *ValidationResult + func (s *Section) ValidateAsync(ctx context.Context, data map[string]any) *ValidationResult + func (s *Section) ValidateFull(ctx context.Context, data map[string]any) *ValidationResult + type SectionBuilder struct + func NewSectionBuilder(id, title string) *SectionBuilder + func (b *SectionBuilder) AddField(field *Field) *SectionBuilder + func (b *SectionBuilder) AddFields(fields ...*Field) *SectionBuilder + func (b *SectionBuilder) Build() *Section + func (b *SectionBuilder) Collapsible() *SectionBuilder + func (b *SectionBuilder) DefaultCollapsed() *SectionBuilder + func (b *SectionBuilder) Description(desc string) *SectionBuilder + func (b *SectionBuilder) HelpURL(url string) *SectionBuilder + func (b *SectionBuilder) Icon(icon string) *SectionBuilder + func (b *SectionBuilder) Order(order int) *SectionBuilder + func (b *SectionBuilder) ReadOnly() *SectionBuilder + func (b *SectionBuilder) WithMetadata(key string, value any) *SectionBuilder + func (b *SectionBuilder) WithPermissions(perms ...string) *SectionBuilder + type SelectOption struct + Description string + Disabled bool + Group string + Icon string + Label string + Value any + type SettingsMigrator interface + MigrateSettings func(ctx context.Context, appID string, data map[string]any, ...) (map[string]any, error) + type SettingsProvider interface + GetSettingsSchema func() *Schema + GetSettingsSections func() []*Section + ProviderID func() string + type SettingsValidator interface + ValidateSettings func(ctx context.Context, appID string, sectionID string, data map[string]any) *ValidationResult + type UniqueCheckFunc func(ctx context.Context, value any) (bool, error) + type ValidationError struct + FieldID string + Message string + ValidatorID string + func NewValidationError(fieldID, validatorID, format string, args ...any) *ValidationError + func (e *ValidationError) Error() string + type ValidationResult struct + FieldErrors map[string][]*ValidationError + GlobalErrors []string + Valid bool + func NewValidationResult() *ValidationResult + func (r *ValidationResult) AddFieldError(fieldID, validatorID, message string) + func (r *ValidationResult) AddGlobalError(message string) + func (r *ValidationResult) AllErrors() []*ValidationError + func (r *ValidationResult) Error() string + func (r *ValidationResult) ErrorMessages() []string + func (r *ValidationResult) GetFieldErrors(fieldID string) []*ValidationError + func (r *ValidationResult) GetFirstFieldError(fieldID string) *ValidationError + func (r *ValidationResult) HasErrors() bool + func (r *ValidationResult) HasFieldError(fieldID string) bool + func (r *ValidationResult) Merge(other *ValidationResult) + func (r *ValidationResult) ToMap() map[string]any + type Validator interface + Name func() string + Validate func(value any) error + func AlphanumericValidator() Validator + func ArrayMaxLengthValidator(max int) Validator + func ArrayMinLengthValidator(min int) Validator + func CIDRValidator() Validator + func CompositeValidator(validators ...Validator) Validator + func CustomValidator(name string, message string, fn func(value any) bool) Validator + func EmailValidator() Validator + func EnumValidator(allowed []any) Validator + func HexColorValidator() Validator + func IPAddressValidator() Validator + func JSONValidator() Validator + func MaxLengthValidator(max int) Validator + func MaxValueValidator(max float64) Validator + func MinLengthValidator(min int) Validator + func MinValueValidator(min float64) Validator + func NewValidator(name string, fn func(value any) error) Validator + func NotEmptyValidator() Validator + func PasswordStrengthValidator(minLength int, ...) Validator + func PatternValidator(pattern string, message string) Validator + func PhoneValidator() Validator + func RangeValidator(min, max float64) Validator + func RequiredValidator() Validator + func SlugValidator() Validator + func StringEnumValidator(allowed ...string) Validator + func URLValidator() Validator + func URLWithSchemeValidator(schemes ...string) Validator + type ValidatorConfig struct + Message string + Params map[string]any + Type string + type ValidatorFunc struct + func (v ValidatorFunc) Name() string + func (v ValidatorFunc) Validate(value any) error