Versions in this module Expand all Collapse all v0 v0.8.3-wip Apr 21, 2026 v0.8.2 Apr 19, 2026 v0.8.1 Apr 4, 2026 Changes in this version + const OpAppend + const OpCAS + const OpIncrement + const OpRemove + const OpToggle + func ValidFieldOps() []string + func ValidateFieldOp(def *FieldDef, op *FieldOp) error + type FieldOp struct + Ceiling *float64 + Expect any + Floor *float64 + Op string + Value any + func AsFieldOp(val any) (*FieldOp, bool) v0.8.0 Mar 28, 2026 Changes in this version + const EntityAgent + const EntityArticle + const EntityContact + const EntityCustomerGroup + const EntityGroup + const EntityOrganisation + const EntityQueue + const EntityTicket + const FieldAddress + const FieldBoolean + const FieldDate + const FieldDateTime + const FieldDecimal + const FieldEmail + const FieldInteger + const FieldMultiSelect + const FieldPhone + const FieldPoint + const FieldPolygon + const FieldSelect + const FieldText + const FieldTextArea + const FieldURL + const OwnerAdmin + const OwnerLegacy + const OwnerPlugin + func IsValidEntityType(et string) bool + func IsValidFieldType(ft string) bool + func MigrateLegacyFields(logger *slog.Logger) error + func StorageColumn(fieldType string) string + func ValidEntityTypes() []string + func ValidFieldTypes() []string + func ValidFilterOperators() []string + func ValidateFieldDef(f *FieldDef) error + func ValidateValue(def *FieldDef, val any) error + func ValidateValues(defs map[string]*FieldDef, values map[string]any) map[string]string + type Address struct + City string + Country string + Lat float64 + Line1 string + Line2 string + Lng float64 + Postcode string + Region string + type FieldConfig struct + AllowEmpty bool + AllowedSchemes []string + Countries []string + DefaultCenter *LatLng + DefaultZoom *int + FutureOnly bool + GeocodeProvider string + Max *float64 + MaxDate string + MaxLength *int + MaxSelected *int + Min *float64 + MinDate string + MinSelected *int + Options []SelectOption + Regex string + RegexError string + Searchable bool + Step *float64 + type FieldDef struct + ChangeBy int + ChangeTime time.Time + Config *json.RawMessage + CreateBy int + CreateTime time.Time + Description *string + EntityType string + FieldOrder int + FieldType string + ID int64 + Label string + MigratedFrom *int64 + Name string + OwnerName *string + OwnerType string + Placeholder *string + Required bool + Section string + ValidID int + func (f *FieldDef) IsActive() bool + func (f *FieldDef) ParsedConfig() (*FieldConfig, error) + type FieldFilter struct + Field string + Operator string + Value any + Value2 any + type FieldValue struct + FieldID int64 + ID int64 + ObjectID int64 + ValDate *time.Time + ValDatetime *time.Time + ValDecimal *float64 + ValDecimal2 *float64 + ValInt *int64 + ValJSON *json.RawMessage + ValText *string + type LatLng struct + Lat float64 + Lng float64 + type Repository struct + func NewRepository() (*Repository, error) + func NewRepositoryWithDB(db *sql.DB) *Repository + func (r *Repository) CreateDef(f *FieldDef, userID int) (int64, error) + func (r *Repository) GetDef(id int64) (*FieldDef, error) + func (r *Repository) GetDefByEntityAndName(entityType, name string) (*FieldDef, error) + func (r *Repository) GetValues(entityType string, objectID int64, fieldNames []string) (map[string]any, error) + func (r *Repository) HardDeleteDef(id int64) error + func (r *Repository) ListDefs(entityType, ownerType, ownerName string, activeOnly bool) ([]FieldDef, error) + func (r *Repository) QueryByFields(entityType string, filters []FieldFilter) ([]int64, error) + func (r *Repository) SetValues(entityType string, objectID int64, values map[string]any) error + func (r *Repository) SoftDeleteDef(id int64, userID int) error + func (r *Repository) UpdateDef(f *FieldDef, userID int) error + type SelectOption struct + Label string + Value string