Documentation
¶
Index ¶
- Variables
- func MatchTypeProperty1[T any](t *TypeProperty, m TypePropertyMatch1[T]) (res T)
- type Builder
- func (b *Builder) Build() (*Schema, error)
- func (b *Builder) Fields(fields FieldList) *Builder
- func (b *Builder) ID(id ID) *Builder
- func (b *Builder) MustBuild() *Schema
- func (b *Builder) NewID() *Builder
- func (b *Builder) Project(project ProjectID) *Builder
- func (b *Builder) TitleField(fid *FieldID) *Builder
- func (b *Builder) Workspace(workspace accountdomain.WorkspaceID) *Builder
- type CorrespondingField
- type Field
- func (f *Field) Clone() *Field
- func (f *Field) CreatedAt() time.Time
- func (f *Field) DefaultValue() *value.Multiple
- func (f *Field) Description() string
- func (f *Field) ID() FieldID
- func (f *Field) IsGeometryField() bool
- func (f *Field) IsPrimitive() bool
- func (f *Field) Key() id.Key
- func (f *Field) Multiple() bool
- func (f *Field) Name() string
- func (f *Field) Order() int
- func (f *Field) ParseValue(raw any) (*value.Multiple, FieldValidationErrors)
- func (f *Field) Required() bool
- func (f *Field) SetDefaultValue(v *value.Multiple) error
- func (f *Field) SetDescription(description string)
- func (f *Field) SetKey(key id.Key) error
- func (f *Field) SetMultiple(m bool)
- func (f *Field) SetName(name string)
- func (f *Field) SetOrder(o int)
- func (f *Field) SetRequired(req bool)
- func (f *Field) SetTypeProperty(tp *TypeProperty) error
- func (f *Field) SetUnique(unique bool)
- func (f *Field) SupportsPointField() bool
- func (f *Field) Type() value.Type
- func (f *Field) TypeProperty() *TypeProperty
- func (f *Field) Unique() bool
- func (f *Field) UpdatedAt() time.Time
- func (f *Field) Validate(m *value.Multiple) FieldValidationErrors
- func (f *Field) ValidationError(err error, fallback FieldValidationCode) FieldValidationError
- type FieldAsset
- type FieldBool
- type FieldBuilder
- func (b *FieldBuilder) Build() (*Field, error)
- func (b *FieldBuilder) DefaultValue(v *value.Multiple) *FieldBuilder
- func (b *FieldBuilder) Description(description string) *FieldBuilder
- func (b *FieldBuilder) ID(id FieldID) *FieldBuilder
- func (b *FieldBuilder) Key(key id.Key) *FieldBuilder
- func (b *FieldBuilder) Multiple(multiple bool) *FieldBuilder
- func (b *FieldBuilder) MustBuild() *Field
- func (b *FieldBuilder) Name(name string) *FieldBuilder
- func (b *FieldBuilder) NewID() *FieldBuilder
- func (b *FieldBuilder) Order(o int) *FieldBuilder
- func (b *FieldBuilder) RandomKey() *FieldBuilder
- func (b *FieldBuilder) Required(required bool) *FieldBuilder
- func (b *FieldBuilder) Type(tp *TypeProperty) *FieldBuilder
- func (b *FieldBuilder) Unique(unique bool) *FieldBuilder
- func (b *FieldBuilder) UpdatedAt(t time.Time) *FieldBuilder
- type FieldCheckbox
- type FieldDateTime
- type FieldGeometry
- type FieldGeometryEditor
- func (f *FieldGeometryEditor) Clone() *FieldGeometryEditor
- func (f *FieldGeometryEditor) SupportedTypes() GeometryEditorSupportedTypeList
- func (f *FieldGeometryEditor) Type() value.Type
- func (f *FieldGeometryEditor) TypeProperty() *TypeProperty
- func (f *FieldGeometryEditor) Validate(v *value.Value) (err error)
- func (f *FieldGeometryEditor) ValidateMultiple(_ *value.Multiple) (err error)
- type FieldGeometryObject
- func (f *FieldGeometryObject) Clone() *FieldGeometryObject
- func (f *FieldGeometryObject) SupportedTypes() GeometryObjectSupportedTypeList
- func (f *FieldGeometryObject) Type() value.Type
- func (f *FieldGeometryObject) TypeProperty() *TypeProperty
- func (f *FieldGeometryObject) Validate(v *value.Value) (err error)
- func (f *FieldGeometryObject) ValidateMultiple(_ *value.Multiple) (err error)
- type FieldGroup
- type FieldID
- type FieldIDOrKey
- type FieldInteger
- func (f *FieldInteger) Clone() *FieldInteger
- func (f *FieldInteger) Max() *int64
- func (f *FieldInteger) Min() *int64
- func (f *FieldInteger) Type() value.Type
- func (f *FieldInteger) TypeProperty() *TypeProperty
- func (f *FieldInteger) Validate(v *value.Value) (err error)
- func (f *FieldInteger) ValidateMultiple(_ *value.Multiple) error
- type FieldKey
- type FieldKeySet
- type FieldList
- type FieldMarkdown
- func (f *FieldMarkdown) Clone() *FieldMarkdown
- func (f *FieldMarkdown) MaxLength() *int
- func (f *FieldMarkdown) Type() value.Type
- func (f *FieldMarkdown) TypeProperty() *TypeProperty
- func (f *FieldMarkdown) Validate(v *value.Value) error
- func (f *FieldMarkdown) ValidateMultiple(v *value.Multiple) error
- type FieldNumber
- func (f *FieldNumber) Clone() *FieldNumber
- func (f *FieldNumber) Max() *float64
- func (f *FieldNumber) Min() *float64
- func (f *FieldNumber) Type() value.Type
- func (f *FieldNumber) TypeProperty() *TypeProperty
- func (f *FieldNumber) Validate(v *value.Value) (err error)
- func (f *FieldNumber) ValidateMultiple(v *value.Multiple) error
- type FieldReference
- func (f *FieldReference) Clone() *FieldReference
- func (f *FieldReference) CorrespondingField() *CorrespondingField
- func (f *FieldReference) CorrespondingFieldID() *id.FieldID
- func (f *FieldReference) IsTwoWay() bool
- func (f *FieldReference) Model() model.ID
- func (f *FieldReference) Schema() id.SchemaID
- func (f *FieldReference) Type() value.Type
- func (f *FieldReference) TypeProperty() *TypeProperty
- func (f *FieldReference) Validate(v *value.Value) (err error)
- func (f *FieldReference) ValidateMultiple(_ *value.Multiple) error
- type FieldRichText
- func (f *FieldRichText) Clone() *FieldRichText
- func (f *FieldRichText) MaxLength() *int
- func (f *FieldRichText) Type() value.Type
- func (f *FieldRichText) TypeProperty() *TypeProperty
- func (f *FieldRichText) Validate(v *value.Value) error
- func (f *FieldRichText) ValidateMultiple(v *value.Multiple) error
- type FieldSelect
- type FieldString
- type FieldTag
- type FieldText
- type FieldTextArea
- func (f *FieldTextArea) Clone() *FieldTextArea
- func (f *FieldTextArea) MaxLength() *int
- func (f *FieldTextArea) Type() value.Type
- func (f *FieldTextArea) TypeProperty() *TypeProperty
- func (f *FieldTextArea) Validate(v *value.Value) error
- func (f *FieldTextArea) ValidateMultiple(v *value.Multiple) error
- type FieldURL
- type FieldValidationCode
- type FieldValidationError
- type FieldValidationErrors
- func (e FieldValidationErrors) Empty() bool
- func (e FieldValidationErrors) Error() string
- func (e FieldValidationErrors) Keys() FieldKeySet
- func (e FieldValidationErrors) StatusCode() int
- func (e FieldValidationErrors) Unwrap() []error
- func (e FieldValidationErrors) WithGroup(g *id.ItemGroupID) FieldValidationErrors
- type GeometryEditorSupportedType
- type GeometryEditorSupportedTypeList
- type GeometryObjectSupportedType
- type GeometryObjectSupportedTypeList
- type GroupID
- type GroupIDList
- type GuessFieldData
- type ID
- type IDList
- type List
- type Package
- func (p *Package) Field(fieldID id.FieldID) *Field
- func (p *Package) FieldByIDOrKey(fID *id.FieldID, k *id.Key) *Field
- func (p *Package) FieldsByType(t value.Type) FieldList
- func (p *Package) GroupSchema(gid id.GroupID) *Schema
- func (p *Package) GroupSchemas() List
- func (p *Package) MetaSchema() *Schema
- func (p *Package) ReferencedSchema(fieldID id.FieldID) *Schema
- func (p *Package) ReferencedSchemas() List
- func (p *Package) Schema() *Schema
- func (p *Package) SchemaByID(schemaID id.SchemaID) *Schema
- func (p *Package) SchemaByModel(mID id.ModelID) *Schema
- type ProjectID
- type Schema
- func (s *Schema) AddField(f *Field)
- func (s *Schema) Clone() *Schema
- func (s *Schema) CopyFrom(s2 *Schema)
- func (s *Schema) Field(fId FieldID) *Field
- func (s *Schema) FieldByIDOrKey(fId *FieldID, key *id.Key) *Field
- func (s *Schema) Fields() FieldList
- func (s *Schema) FieldsByType(t value.Type) FieldList
- func (s *Schema) FirstGeometryField() *Field
- func (s *Schema) Groups() GroupIDList
- func (s *Schema) GuessSchemaFieldFromJson(file io.Reader, isGeoJSON, appendGeoField bool) ([]GuessFieldData, error)
- func (s *Schema) HasField(f FieldID) bool
- func (s *Schema) HasFieldByKey(k string) bool
- func (s *Schema) HasGeometryFields() bool
- func (s *Schema) ID() ID
- func (s *Schema) IsPointFieldSupported() bool
- func (s *Schema) Project() ProjectID
- func (s *Schema) ReferencedSchemas() IDList
- func (s *Schema) RemoveField(fid FieldID)
- func (s *Schema) SetTitleField(tf *FieldID) error
- func (s *Schema) SetWorkspace(workspace accountdomain.WorkspaceID)
- func (s *Schema) TitleField() *FieldID
- func (s *Schema) Workspace() accountdomain.WorkspaceID
- type Tag
- type TagColor
- type TagID
- type TagIDList
- type TagList
- type TypeProperty
- type TypePropertyMatch
- type TypePropertyMatch1
- type WorkspaceID
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFieldNotFound = rerror.NewE(i18n.T("field not found for the given schema")) ErrFieldValueNotMultiple = rerror.NewE(i18n.T("field value must be a list for the given schema field")) ErrFieldValueMultiple = rerror.NewE(i18n.T("field value must not be a list for the given schema field")) )
View Source
var ( ErrUnsupportedType = rerror.NewE(i18n.T("unsupported geometry type")) ErrGeoFieldMaxSizeExceeded = rerror.NewE(i18n.T("Geo field max size exceeded")) ErrGeoFieldInvalidGeoStructure = rerror.NewE(i18n.T("invalid Geo field structure")) )
View Source
var ( ErrInvalidMinMax = rerror.NewE(i18n.T("max must be larger then min")) ErrIntegerFieldMinExceeded = func(min int64) error { return rerror.FmtE(i18n.T("value should be larger than %d"), min) } ErrIntegerFieldMaxExceeded = func(max int64) error { return rerror.FmtE(i18n.T("value should be smaller than %d"), max) } )
View Source
var ( ErrFieldValues = rerror.NewE(i18n.T("invalid values")) ErrFieldDefaultValue = rerror.NewE(i18n.T("invalid default values")) )
View Source
var ErrDuplicatedTag = errors.New("duplicated tag")
View Source
var ErrInvalidFieldID = id.ErrInvalidID
View Source
var ErrInvalidID = id.ErrInvalidID
View Source
var ErrInvalidKey = rerror.NewE(i18n.T("invalid key"))
View Source
var ErrInvalidTagID = id.ErrInvalidID
View Source
var ErrInvalidTitleField = errors.New("title field must be one of schema fields")
View Source
var ErrInvalidType = rerror.NewE(i18n.T("invalid type"))
View Source
var ErrInvalidValue = rerror.NewE(i18n.T("invalid value"))
View Source
var ErrStringFieldMaxLengthExceeded = func(max int) error { return rerror.FmtE(i18n.T("value should be shorter than %d characters"), max) }
View Source
var ErrURLFieldMaxLengthExceeded = rerror.NewE(i18n.T("URL field max length exceeded"))
View Source
var ErrValueRequired = rerror.NewE(i18n.T("value is required"))
View Source
var FieldIDFrom = id.FieldIDFrom
View Source
var FieldIDFromRef = id.FieldIDFromRef
View Source
var IDFrom = id.SchemaIDFrom
View Source
var IDFromRef = id.SchemaIDFromRef
View Source
var IDListFrom = id.SchemaIDListFrom
View Source
var MustFieldID = id.MustFieldID
View Source
var MustID = id.MustSchemaID
View Source
var MustTagID = id.MustTagID
View Source
var NewFieldID = id.NewFieldID
View Source
var NewID = id.NewSchemaID
View Source
var NewTagID = id.NewTagID
View Source
var TagIDFrom = id.TagIDFrom
View Source
var TagIDFromRef = id.TagIDFromRef
Functions ¶
func MatchTypeProperty1 ¶
func MatchTypeProperty1[T any](t *TypeProperty, m TypePropertyMatch1[T]) (res T)
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func (*Builder) TitleField ¶
func (*Builder) Workspace ¶
func (b *Builder) Workspace(workspace accountdomain.WorkspaceID) *Builder
type CorrespondingField ¶
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
func (*Field) DefaultValue ¶
func (*Field) Description ¶
func (*Field) IsGeometryField ¶
func (*Field) IsPrimitive ¶
func (*Field) ParseValue ¶
func (f *Field) ParseValue(raw any) (*value.Multiple, FieldValidationErrors)
func (*Field) SetDescription ¶
func (*Field) SetMultiple ¶
func (*Field) SetRequired ¶
func (*Field) SetTypeProperty ¶
func (f *Field) SetTypeProperty(tp *TypeProperty) error
func (*Field) SupportsPointField ¶
func (*Field) TypeProperty ¶
func (f *Field) TypeProperty() *TypeProperty
func (*Field) ValidationError ¶
func (f *Field) ValidationError(err error, fallback FieldValidationCode) FieldValidationError
type FieldAsset ¶
type FieldAsset struct {
}
func NewAsset ¶
func NewAsset() *FieldAsset
func (*FieldAsset) Clone ¶
func (f *FieldAsset) Clone() *FieldAsset
func (*FieldAsset) Type ¶
func (f *FieldAsset) Type() value.Type
func (*FieldAsset) TypeProperty ¶
func (f *FieldAsset) TypeProperty() *TypeProperty
func (*FieldAsset) ValidateMultiple ¶
func (f *FieldAsset) ValidateMultiple(v *value.Multiple) error
type FieldBool ¶
type FieldBool struct {
}
func (*FieldBool) TypeProperty ¶
func (f *FieldBool) TypeProperty() *TypeProperty
type FieldBuilder ¶
type FieldBuilder struct {
// contains filtered or unexported fields
}
func NewField ¶
func NewField(tp *TypeProperty) *FieldBuilder
func NewFieldWithDefaultProperty ¶
func NewFieldWithDefaultProperty(t value.Type) *FieldBuilder
func (*FieldBuilder) Build ¶
func (b *FieldBuilder) Build() (*Field, error)
func (*FieldBuilder) DefaultValue ¶
func (b *FieldBuilder) DefaultValue(v *value.Multiple) *FieldBuilder
func (*FieldBuilder) Description ¶
func (b *FieldBuilder) Description(description string) *FieldBuilder
func (*FieldBuilder) ID ¶
func (b *FieldBuilder) ID(id FieldID) *FieldBuilder
func (*FieldBuilder) Key ¶
func (b *FieldBuilder) Key(key id.Key) *FieldBuilder
func (*FieldBuilder) Multiple ¶
func (b *FieldBuilder) Multiple(multiple bool) *FieldBuilder
func (*FieldBuilder) MustBuild ¶
func (b *FieldBuilder) MustBuild() *Field
func (*FieldBuilder) Name ¶
func (b *FieldBuilder) Name(name string) *FieldBuilder
func (*FieldBuilder) NewID ¶
func (b *FieldBuilder) NewID() *FieldBuilder
func (*FieldBuilder) Order ¶
func (b *FieldBuilder) Order(o int) *FieldBuilder
func (*FieldBuilder) RandomKey ¶
func (b *FieldBuilder) RandomKey() *FieldBuilder
func (*FieldBuilder) Required ¶
func (b *FieldBuilder) Required(required bool) *FieldBuilder
func (*FieldBuilder) Type ¶
func (b *FieldBuilder) Type(tp *TypeProperty) *FieldBuilder
func (*FieldBuilder) Unique ¶
func (b *FieldBuilder) Unique(unique bool) *FieldBuilder
func (*FieldBuilder) UpdatedAt ¶
func (b *FieldBuilder) UpdatedAt(t time.Time) *FieldBuilder
type FieldCheckbox ¶
type FieldCheckbox struct {
}
func NewCheckbox ¶
func NewCheckbox() *FieldCheckbox
func (*FieldCheckbox) Clone ¶
func (f *FieldCheckbox) Clone() *FieldCheckbox
func (*FieldCheckbox) Type ¶
func (f *FieldCheckbox) Type() value.Type
func (*FieldCheckbox) TypeProperty ¶
func (f *FieldCheckbox) TypeProperty() *TypeProperty
func (*FieldCheckbox) ValidateMultiple ¶
func (f *FieldCheckbox) ValidateMultiple(_ *value.Multiple) error
type FieldDateTime ¶
type FieldDateTime struct{}
func NewDateTime ¶
func NewDateTime() *FieldDateTime
func (*FieldDateTime) Clone ¶
func (f *FieldDateTime) Clone() *FieldDateTime
func (*FieldDateTime) Type ¶
func (f *FieldDateTime) Type() value.Type
func (*FieldDateTime) TypeProperty ¶
func (f *FieldDateTime) TypeProperty() *TypeProperty
func (*FieldDateTime) ValidateMultiple ¶
func (f *FieldDateTime) ValidateMultiple(v *value.Multiple) error
type FieldGeometry ¶
type FieldGeometry struct{}
FieldGeometry is the unified geometry field. It accepts any GeoJSON geometry and has no geometry-specific configuration.
func NewGeometry ¶
func NewGeometry() *FieldGeometry
func (*FieldGeometry) Clone ¶
func (f *FieldGeometry) Clone() *FieldGeometry
func (*FieldGeometry) Type ¶
func (f *FieldGeometry) Type() value.Type
func (*FieldGeometry) TypeProperty ¶
func (f *FieldGeometry) TypeProperty() *TypeProperty
func (*FieldGeometry) ValidateMultiple ¶
func (f *FieldGeometry) ValidateMultiple(_ *value.Multiple) error
type FieldGeometryEditor ¶
type FieldGeometryEditor struct {
// contains filtered or unexported fields
}
func NewGeometryEditor ¶
func NewGeometryEditor(supportedTypes GeometryEditorSupportedTypeList) *FieldGeometryEditor
func (*FieldGeometryEditor) Clone ¶
func (f *FieldGeometryEditor) Clone() *FieldGeometryEditor
func (*FieldGeometryEditor) SupportedTypes ¶
func (f *FieldGeometryEditor) SupportedTypes() GeometryEditorSupportedTypeList
func (*FieldGeometryEditor) Type ¶
func (f *FieldGeometryEditor) Type() value.Type
func (*FieldGeometryEditor) TypeProperty ¶
func (f *FieldGeometryEditor) TypeProperty() *TypeProperty
func (*FieldGeometryEditor) Validate ¶
func (f *FieldGeometryEditor) Validate(v *value.Value) (err error)
func (*FieldGeometryEditor) ValidateMultiple ¶
func (f *FieldGeometryEditor) ValidateMultiple(_ *value.Multiple) (err error)
type FieldGeometryObject ¶
type FieldGeometryObject struct {
// contains filtered or unexported fields
}
func NewGeometryObject ¶
func NewGeometryObject(supportedTypes GeometryObjectSupportedTypeList) *FieldGeometryObject
func (*FieldGeometryObject) Clone ¶
func (f *FieldGeometryObject) Clone() *FieldGeometryObject
func (*FieldGeometryObject) SupportedTypes ¶
func (f *FieldGeometryObject) SupportedTypes() GeometryObjectSupportedTypeList
func (*FieldGeometryObject) Type ¶
func (f *FieldGeometryObject) Type() value.Type
func (*FieldGeometryObject) TypeProperty ¶
func (f *FieldGeometryObject) TypeProperty() *TypeProperty
func (*FieldGeometryObject) Validate ¶
func (f *FieldGeometryObject) Validate(v *value.Value) (err error)
func (*FieldGeometryObject) ValidateMultiple ¶
func (f *FieldGeometryObject) ValidateMultiple(_ *value.Multiple) (err error)
type FieldGroup ¶
type FieldGroup struct {
// contains filtered or unexported fields
}
func FieldGroupFromTypeProperty ¶
func FieldGroupFromTypeProperty(tp *TypeProperty) (*FieldGroup, bool)
func NewGroup ¶
func NewGroup(gid GroupID) *FieldGroup
func (*FieldGroup) Clone ¶
func (f *FieldGroup) Clone() *FieldGroup
func (*FieldGroup) Group ¶
func (f *FieldGroup) Group() GroupID
func (*FieldGroup) Type ¶
func (f *FieldGroup) Type() value.Type
func (*FieldGroup) TypeProperty ¶
func (f *FieldGroup) TypeProperty() *TypeProperty
func (*FieldGroup) ValidateMultiple ¶
func (f *FieldGroup) ValidateMultiple(v *value.Multiple) error
type FieldIDOrKey ¶
type FieldIDOrKey string
type FieldInteger ¶
type FieldInteger struct {
// contains filtered or unexported fields
}
func MustNewInteger ¶
func MustNewInteger(min, max *int64) *FieldInteger
func NewInteger ¶
func NewInteger(min, max *int64) (*FieldInteger, error)
func (*FieldInteger) Clone ¶
func (f *FieldInteger) Clone() *FieldInteger
func (*FieldInteger) Max ¶
func (f *FieldInteger) Max() *int64
func (*FieldInteger) Min ¶
func (f *FieldInteger) Min() *int64
func (*FieldInteger) Type ¶
func (f *FieldInteger) Type() value.Type
func (*FieldInteger) TypeProperty ¶
func (f *FieldInteger) TypeProperty() *TypeProperty
func (*FieldInteger) ValidateMultiple ¶
func (f *FieldInteger) ValidateMultiple(_ *value.Multiple) error
type FieldKey ¶
type FieldKey struct {
Field FieldID
Group id.ItemGroupID
}
FieldKey identifies a field value inside an item: a top-level field (Group == nil) or a field in a group instance.
func NewFieldKey ¶
func NewFieldKey(f FieldID, g *id.ItemGroupID) FieldKey
type FieldKeySet ¶
type FieldKeySet map[FieldKey]struct{}
func (FieldKeySet) Has ¶
func (s FieldKeySet) Has(f FieldID, g *id.ItemGroupID) bool
type FieldList ¶
type FieldList []*Field
func (FieldList) IDs ¶
func (l FieldList) IDs() (ids id.FieldIDList)
type FieldMarkdown ¶
type FieldMarkdown struct {
// contains filtered or unexported fields
}
func NewMarkdown ¶
func NewMarkdown(maxLength *int) *FieldMarkdown
func (*FieldMarkdown) Clone ¶
func (f *FieldMarkdown) Clone() *FieldMarkdown
func (*FieldMarkdown) MaxLength ¶
func (f *FieldMarkdown) MaxLength() *int
func (*FieldMarkdown) Type ¶
func (f *FieldMarkdown) Type() value.Type
func (*FieldMarkdown) TypeProperty ¶
func (f *FieldMarkdown) TypeProperty() *TypeProperty
func (*FieldMarkdown) ValidateMultiple ¶
func (f *FieldMarkdown) ValidateMultiple(v *value.Multiple) error
type FieldNumber ¶
type FieldNumber struct {
// contains filtered or unexported fields
}
func NewNumber ¶
func NewNumber(min, max *float64) (*FieldNumber, error)
func (*FieldNumber) Clone ¶
func (f *FieldNumber) Clone() *FieldNumber
func (*FieldNumber) Max ¶
func (f *FieldNumber) Max() *float64
func (*FieldNumber) Min ¶
func (f *FieldNumber) Min() *float64
func (*FieldNumber) Type ¶
func (f *FieldNumber) Type() value.Type
func (*FieldNumber) TypeProperty ¶
func (f *FieldNumber) TypeProperty() *TypeProperty
func (*FieldNumber) ValidateMultiple ¶
func (f *FieldNumber) ValidateMultiple(v *value.Multiple) error
type FieldReference ¶
type FieldReference struct {
// contains filtered or unexported fields
}
func FieldReferenceFromTypeProperty ¶
func FieldReferenceFromTypeProperty(tp *TypeProperty) (*FieldReference, bool)
func NewReference ¶
func NewReference(mID id.ModelID, sID id.SchemaID, cfID *id.FieldID, cf *CorrespondingField) *FieldReference
func (*FieldReference) Clone ¶
func (f *FieldReference) Clone() *FieldReference
func (*FieldReference) CorrespondingField ¶
func (f *FieldReference) CorrespondingField() *CorrespondingField
CorrespondingField returns the corresponding field of this reference from user input. This is not stored in the database.
func (*FieldReference) CorrespondingFieldID ¶
func (f *FieldReference) CorrespondingFieldID() *id.FieldID
func (*FieldReference) IsTwoWay ¶
func (f *FieldReference) IsTwoWay() bool
func (*FieldReference) Model ¶
func (f *FieldReference) Model() model.ID
func (*FieldReference) Schema ¶
func (f *FieldReference) Schema() id.SchemaID
func (*FieldReference) Type ¶
func (f *FieldReference) Type() value.Type
func (*FieldReference) TypeProperty ¶
func (f *FieldReference) TypeProperty() *TypeProperty
func (*FieldReference) ValidateMultiple ¶
func (f *FieldReference) ValidateMultiple(_ *value.Multiple) error
type FieldRichText ¶
type FieldRichText struct {
// contains filtered or unexported fields
}
func NewRichText ¶
func NewRichText(maxLength *int) *FieldRichText
func (*FieldRichText) Clone ¶
func (f *FieldRichText) Clone() *FieldRichText
func (*FieldRichText) MaxLength ¶
func (f *FieldRichText) MaxLength() *int
func (*FieldRichText) Type ¶
func (f *FieldRichText) Type() value.Type
func (*FieldRichText) TypeProperty ¶
func (f *FieldRichText) TypeProperty() *TypeProperty
func (*FieldRichText) ValidateMultiple ¶
func (f *FieldRichText) ValidateMultiple(v *value.Multiple) error
type FieldSelect ¶
type FieldSelect struct {
// contains filtered or unexported fields
}
func NewSelect ¶
func NewSelect(values []string) *FieldSelect
func (*FieldSelect) Clone ¶
func (f *FieldSelect) Clone() *FieldSelect
func (*FieldSelect) Type ¶
func (*FieldSelect) Type() value.Type
func (*FieldSelect) TypeProperty ¶
func (f *FieldSelect) TypeProperty() *TypeProperty
func (*FieldSelect) ValidateMultiple ¶
func (f *FieldSelect) ValidateMultiple(v *value.Multiple) error
func (*FieldSelect) Values ¶
func (f *FieldSelect) Values() []string
type FieldString ¶
type FieldString struct {
// contains filtered or unexported fields
}
func (*FieldString) Clone ¶
func (f *FieldString) Clone() *FieldString
func (*FieldString) MaxLength ¶
func (f *FieldString) MaxLength() *int
func (*FieldString) Type ¶
func (f *FieldString) Type() value.Type
func (*FieldString) ValidateMultiple ¶
func (f *FieldString) ValidateMultiple(_ *value.Multiple) error
type FieldTag ¶
type FieldTag struct {
// contains filtered or unexported fields
}
func NewFieldTag ¶
func (*FieldTag) TypeProperty ¶
func (f *FieldTag) TypeProperty() *TypeProperty
type FieldText ¶
type FieldText struct {
// contains filtered or unexported fields
}
func (*FieldText) TypeProperty ¶
func (f *FieldText) TypeProperty() *TypeProperty
type FieldTextArea ¶
type FieldTextArea struct {
// contains filtered or unexported fields
}
func NewTextArea ¶
func NewTextArea(maxLength *int) *FieldTextArea
func (*FieldTextArea) Clone ¶
func (f *FieldTextArea) Clone() *FieldTextArea
func (*FieldTextArea) MaxLength ¶
func (f *FieldTextArea) MaxLength() *int
func (*FieldTextArea) Type ¶
func (f *FieldTextArea) Type() value.Type
func (*FieldTextArea) TypeProperty ¶
func (f *FieldTextArea) TypeProperty() *TypeProperty
func (*FieldTextArea) ValidateMultiple ¶
func (f *FieldTextArea) ValidateMultiple(v *value.Multiple) error
type FieldURL ¶
type FieldURL struct {
}
func (*FieldURL) TypeProperty ¶
func (f *FieldURL) TypeProperty() *TypeProperty
type FieldValidationCode ¶
type FieldValidationCode string
const ( FieldValidationCodeRequired FieldValidationCode = "FIELD_REQUIRED" FieldValidationCodeNotFound FieldValidationCode = "FIELD_NOT_FOUND" FieldValidationCodeTypeMismatch FieldValidationCode = "TYPE_MISMATCH" FieldValidationCodeConstraint FieldValidationCode = "CONSTRAINT_VIOLATION" FieldValidationCodeUnique FieldValidationCode = "UNIQUE_VIOLATION" FieldValidationCodeMaxLengthExceeded FieldValidationCode = "MAX_LENGTH_EXCEEDED" FieldValidationCodeMaxSizeExceeded FieldValidationCode = "MAX_SIZE_EXCEEDED" FieldValidationCodeInvalidGeoStructure FieldValidationCode = "INVALID_GEO_STRUCTURE" )
type FieldValidationError ¶
type FieldValidationError struct {
Field *FieldID
Key *id.Key
Index *int
Group *id.ItemGroupID
Code FieldValidationCode
Detail error
}
func (FieldValidationError) AsList ¶
func (e FieldValidationError) AsList() FieldValidationErrors
func (FieldValidationError) Error ¶
func (e FieldValidationError) Error() string
func (FieldValidationError) Unwrap ¶
func (e FieldValidationError) Unwrap() error
func (FieldValidationError) WithGroup ¶
func (e FieldValidationError) WithGroup(g *id.ItemGroupID) FieldValidationError
func (FieldValidationError) WithIndex ¶
func (e FieldValidationError) WithIndex(i int) FieldValidationError
type FieldValidationErrors ¶
type FieldValidationErrors []FieldValidationError
func (FieldValidationErrors) Empty ¶
func (e FieldValidationErrors) Empty() bool
func (FieldValidationErrors) Error ¶
func (e FieldValidationErrors) Error() string
func (FieldValidationErrors) Keys ¶
func (e FieldValidationErrors) Keys() FieldKeySet
Keys returns the set of field values that already have an error, so later validation steps can skip them.
func (FieldValidationErrors) StatusCode ¶
func (e FieldValidationErrors) StatusCode() int
func (FieldValidationErrors) Unwrap ¶
func (e FieldValidationErrors) Unwrap() []error
Unwrap lets errors.Is / errors.As match the underlying error of any field error.
func (FieldValidationErrors) WithGroup ¶
func (e FieldValidationErrors) WithGroup(g *id.ItemGroupID) FieldValidationErrors
type GeometryEditorSupportedType ¶
type GeometryEditorSupportedType string
const ( GeometryEditorSupportedTypePoint GeometryEditorSupportedType = "POINT" GeometryEditorSupportedTypeLineString GeometryEditorSupportedType = "LINESTRING" GeometryEditorSupportedTypePolygon GeometryEditorSupportedType = "POLYGON" GeometryEditorSupportedTypeAny GeometryEditorSupportedType = "ANY" )
func GeometryEditorSupportedTypeFrom ¶
func GeometryEditorSupportedTypeFrom(s string) GeometryEditorSupportedType
func (GeometryEditorSupportedType) String ¶
func (s GeometryEditorSupportedType) String() string
type GeometryEditorSupportedTypeList ¶
type GeometryEditorSupportedTypeList []GeometryEditorSupportedType
func (GeometryEditorSupportedTypeList) First ¶
func (l GeometryEditorSupportedTypeList) First() GeometryEditorSupportedType
func (GeometryEditorSupportedTypeList) Has ¶
func (l GeometryEditorSupportedTypeList) Has(st GeometryEditorSupportedType) bool
func (GeometryEditorSupportedTypeList) Strings ¶
func (l GeometryEditorSupportedTypeList) Strings() []string
type GeometryObjectSupportedType ¶
type GeometryObjectSupportedType string
const ( GeometryObjectSupportedTypePoint GeometryObjectSupportedType = "POINT" GeometryObjectSupportedTypeMultiPoint GeometryObjectSupportedType = "MULTIPOINT" GeometryObjectSupportedTypeLineString GeometryObjectSupportedType = "LINESTRING" GeometryObjectSupportedTypeMultiLineString GeometryObjectSupportedType = "MULTILINESTRING" GeometryObjectSupportedTypePolygon GeometryObjectSupportedType = "POLYGON" GeometryObjectSupportedTypeMultiPolygon GeometryObjectSupportedType = "MULTIPOLYGON" GeometryObjectSupportedTypeGeometryCollection GeometryObjectSupportedType = "GEOMETRYCOLLECTION" )
func GeometryObjectSupportedTypeFrom ¶
func GeometryObjectSupportedTypeFrom(s string) GeometryObjectSupportedType
func (GeometryObjectSupportedType) String ¶
func (s GeometryObjectSupportedType) String() string
type GeometryObjectSupportedTypeList ¶
type GeometryObjectSupportedTypeList []GeometryObjectSupportedType
func GeometryAllSupportedTypes ¶
func GeometryAllSupportedTypes() GeometryObjectSupportedTypeList
func (GeometryObjectSupportedTypeList) First ¶
func (l GeometryObjectSupportedTypeList) First() GeometryObjectSupportedType
func (GeometryObjectSupportedTypeList) Has ¶
func (l GeometryObjectSupportedTypeList) Has(st GeometryObjectSupportedType) bool
func (GeometryObjectSupportedTypeList) Strings ¶
func (l GeometryObjectSupportedTypeList) Strings() []string
type GroupIDList ¶
type GroupIDList = id.GroupIDList
type IDList ¶
type IDList = id.SchemaIDList
type List ¶
type List []*Schema
func (List) Workspaces ¶
func (l List) Workspaces() accountdomain.WorkspaceIDList
type Package ¶
type Package struct {
// contains filtered or unexported fields
}
func NewPackage ¶
func (*Package) FieldByIDOrKey ¶
func (*Package) GroupSchemas ¶
func (*Package) MetaSchema ¶
func (*Package) ReferencedSchemas ¶
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
func (*Schema) FirstGeometryField ¶
func (*Schema) Groups ¶
func (s *Schema) Groups() GroupIDList
func (*Schema) GuessSchemaFieldFromJson ¶
func (*Schema) HasFieldByKey ¶
func (*Schema) HasGeometryFields ¶
func (*Schema) IsPointFieldSupported ¶
func (*Schema) ReferencedSchemas ¶
func (*Schema) RemoveField ¶
func (*Schema) SetTitleField ¶
func (*Schema) SetWorkspace ¶
func (s *Schema) SetWorkspace(workspace accountdomain.WorkspaceID)
func (*Schema) TitleField ¶
func (*Schema) Workspace ¶
func (s *Schema) Workspace() accountdomain.WorkspaceID
type TagColor ¶
type TagColor string
const ( TagColorMagenta TagColor = "magenta" TagColorRed TagColor = "red" TagColorVolcano TagColor = "volcano" TagColorOrange TagColor = "orange" TagColorGold TagColor = "gold" TagColorLime TagColor = "lime" TagColorGreen TagColor = "green" TagColorCyan TagColor = "cyan" TagColorBlue TagColor = "blue" TagColorGeekblue TagColor = "geekblue" TagColorPurple TagColor = "purple" )
func TagColorFrom ¶
type TypeProperty ¶
type TypeProperty struct {
// contains filtered or unexported fields
}
TypeProperty Represent special attributes for some field only one of the type properties should be not nil
func (*TypeProperty) Clone ¶
func (t *TypeProperty) Clone() *TypeProperty
func (*TypeProperty) Match ¶
func (t *TypeProperty) Match(m TypePropertyMatch)
func (*TypeProperty) Type ¶
func (t *TypeProperty) Type() value.Type
func (*TypeProperty) ValidateMultiple ¶
func (t *TypeProperty) ValidateMultiple(v *value.Multiple) error
type TypePropertyMatch ¶
type TypePropertyMatch struct {
Text func(*FieldText)
TextArea func(*FieldTextArea)
RichText func(text *FieldRichText)
Markdown func(*FieldMarkdown)
Asset func(*FieldAsset)
DateTime func(*FieldDateTime)
Bool func(*FieldBool)
Checkbox func(checkbox *FieldCheckbox)
Select func(*FieldSelect)
Tag func(*FieldTag)
Integer func(*FieldInteger)
Number func(*FieldNumber)
Reference func(*FieldReference)
URL func(*FieldURL)
Group func(*FieldGroup)
GeometryObject func(*FieldGeometryObject)
GeometryEditor func(*FieldGeometryEditor)
Geometry func(*FieldGeometry)
Default func()
}
type TypePropertyMatch1 ¶
type TypePropertyMatch1[T any] struct { Text func(*FieldText) T TextArea func(*FieldTextArea) T RichText func(text *FieldRichText) T Markdown func(*FieldMarkdown) T Asset func(*FieldAsset) T DateTime func(*FieldDateTime) T Bool func(*FieldBool) T Checkbox func(checkbox *FieldCheckbox) T Select func(*FieldSelect) T Tag func(*FieldTag) T Integer func(*FieldInteger) T Number func(*FieldNumber) T Reference func(*FieldReference) T URL func(*FieldURL) T Group func(*FieldGroup) T GeometryObject func(*FieldGeometryObject) T GeometryEditor func(*FieldGeometryEditor) T Geometry func(*FieldGeometry) T Default func() T }
type WorkspaceID ¶
type WorkspaceID = id.WorkspaceID
Source Files
¶
- builder.go
- corresponding_field.go
- error.go
- field.go
- field_asset.go
- field_bool.go
- field_builder.go
- field_checkbox.go
- field_datetime.go
- field_geometry.go
- field_geometry_editor.go
- field_geometry_editor_supported_types.go
- field_geometry_object.go
- field_geometry_object_supported_types.go
- field_geometry_validation.go
- field_group.go
- field_integer.go
- field_markdown.go
- field_number.go
- field_reference.go
- field_richtext.go
- field_select.go
- field_string.go
- field_tag.go
- field_tag_color.go
- field_text.go
- field_textarea.go
- field_url.go
- guess.go
- id.go
- list.go
- package.go
- schema.go
- type_property.go
Click to show internal directories.
Click to hide internal directories.