schema

package
v0.0.0-...-b19a234 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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 (
	ErrInvalidMinMax = rerror.NewE(i18n.T("max must be larger then min"))
)
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 ErrUnsupportedType = rerror.NewE(i18n.T("unsupported geometry type"))
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 New

func New() *Builder

func (*Builder) Build

func (b *Builder) Build() (*Schema, error)

func (*Builder) Fields

func (b *Builder) Fields(fields FieldList) *Builder

func (*Builder) ID

func (b *Builder) ID(id ID) *Builder

func (*Builder) MustBuild

func (b *Builder) MustBuild() *Schema

func (*Builder) NewID

func (b *Builder) NewID() *Builder

func (*Builder) Project

func (b *Builder) Project(project ProjectID) *Builder

func (*Builder) TitleField

func (b *Builder) TitleField(fid *FieldID) *Builder

func (*Builder) Workspace

func (b *Builder) Workspace(workspace accountdomain.WorkspaceID) *Builder

type CorrespondingField

type CorrespondingField struct {
	Title       string
	Key         string
	Description string
	Required    bool
}

type Field

type Field struct {
	// contains filtered or unexported fields
}

func CreateCorrespondingField

func CreateCorrespondingField(sid id.SchemaID, mid id.ModelID, f *Field, inp CorrespondingField) (*Field, error)

func (*Field) Clone

func (f *Field) Clone() *Field

func (*Field) CreatedAt

func (f *Field) CreatedAt() time.Time

func (*Field) DefaultValue

func (f *Field) DefaultValue() *value.Multiple

func (*Field) Description

func (f *Field) Description() string

func (*Field) ID

func (f *Field) ID() FieldID

func (*Field) IsGeometryField

func (f *Field) IsGeometryField() bool

func (*Field) Key

func (f *Field) Key() key.Key

func (*Field) Multiple

func (f *Field) Multiple() bool

func (*Field) Name

func (f *Field) Name() string

func (*Field) Order

func (f *Field) Order() int

func (*Field) Required

func (f *Field) Required() bool

func (*Field) SetDefaultValue

func (f *Field) SetDefaultValue(v *value.Multiple) error

func (*Field) SetDescription

func (f *Field) SetDescription(description string)

func (*Field) SetKey

func (f *Field) SetKey(key key.Key) error

func (*Field) SetMultiple

func (f *Field) SetMultiple(m bool)

func (*Field) SetName

func (f *Field) SetName(name string)

func (*Field) SetOrder

func (f *Field) SetOrder(o int)

func (*Field) SetRequired

func (f *Field) SetRequired(req bool)

func (*Field) SetTypeProperty

func (f *Field) SetTypeProperty(tp *TypeProperty) error

func (*Field) SetUnique

func (f *Field) SetUnique(unique bool)

func (*Field) SupportsPointField

func (f *Field) SupportsPointField() bool

func (*Field) Type

func (f *Field) Type() value.Type

func (*Field) TypeProperty

func (f *Field) TypeProperty() *TypeProperty

func (*Field) Unique

func (f *Field) Unique() bool

func (*Field) UpdatedAt

func (f *Field) UpdatedAt() time.Time

func (*Field) Validate

func (f *Field) Validate(m *value.Multiple) error

Validate the Multiple value against the Field schema if its multiple it will return only the first error

func (*Field) ValidateValue

func (f *Field) ValidateValue(m *value.Multiple) error

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) Validate

func (f *FieldAsset) Validate(v *value.Value) (err error)

func (*FieldAsset) ValidateMultiple

func (f *FieldAsset) ValidateMultiple(v *value.Multiple) error

type FieldBool

type FieldBool struct {
}

func NewBool

func NewBool() *FieldBool

func (*FieldBool) Clone

func (f *FieldBool) Clone() *FieldBool

func (*FieldBool) Type

func (f *FieldBool) Type() value.Type

func (*FieldBool) TypeProperty

func (f *FieldBool) TypeProperty() *TypeProperty

func (*FieldBool) Validate

func (f *FieldBool) Validate(v *value.Value) (err error)

func (*FieldBool) ValidateMultiple

func (f *FieldBool) ValidateMultiple(v *value.Multiple) error

type FieldBuilder

type FieldBuilder struct {
	// contains filtered or unexported fields
}

func NewField

func NewField(tp *TypeProperty) *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 key.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) Validate

func (f *FieldCheckbox) Validate(v *value.Value) (err 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) Validate

func (f *FieldDateTime) Validate(v *value.Value) (err error)

func (*FieldDateTime) ValidateMultiple

func (f *FieldDateTime) ValidateMultiple(v *value.Multiple) error

type FieldGeometryEditor

type FieldGeometryEditor struct {
	// contains filtered or unexported fields
}

func NewGeometryEditor

func NewGeometryEditor(supportedTypes GeometryEditorSupportedTypeList) *FieldGeometryEditor

func (*FieldGeometryEditor) Clone

func (*FieldGeometryEditor) SupportedTypes

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(v *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 (*FieldGeometryObject) SupportedTypes

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(v *value.Multiple) (err error)

type FieldGroup

type FieldGroup struct {
	// contains filtered or unexported fields
}

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) Validate

func (f *FieldGroup) Validate(v *value.Value) (err error)

func (*FieldGroup) ValidateMultiple

func (f *FieldGroup) ValidateMultiple(v *value.Multiple) error

type FieldID

type FieldID = id.FieldID

type FieldIDOrKey

type FieldIDOrKey string

type FieldInteger

type FieldInteger struct {
	// contains filtered or unexported fields
}

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) Validate

func (f *FieldInteger) Validate(v *value.Value) (err error)

func (*FieldInteger) ValidateMultiple

func (f *FieldInteger) ValidateMultiple(v *value.Multiple) error

type FieldList

type FieldList []*Field

func (FieldList) Clone

func (l FieldList) Clone() FieldList

func (FieldList) Count

func (l FieldList) Count() int

func (FieldList) Find

func (l FieldList) Find(fid FieldID) *Field

func (FieldList) IDs

func (l FieldList) IDs() (ids id.FieldIDList)

func (FieldList) Ordered

func (l FieldList) Ordered() FieldList

func (FieldList) SortByID

func (l FieldList) SortByID() FieldList

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) Validate

func (f *FieldMarkdown) Validate(v *value.Value) error

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) Validate

func (f *FieldNumber) Validate(v *value.Value) (err error)

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) IsTowWay

func (f *FieldReference) IsTowWay() 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) Validate

func (f *FieldReference) Validate(v *value.Value) (err error)

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) Validate

func (f *FieldRichText) Validate(v *value.Value) error

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) Validate

func (f *FieldSelect) Validate(v *value.Value) (err error)

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 NewString

func NewString(t value.Type, maxLength *int) *FieldString

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) Validate

func (f *FieldString) Validate(v *value.Value) error

type FieldTag

type FieldTag struct {
	// contains filtered or unexported fields
}

func NewFieldTag

func NewFieldTag(tags TagList) (*FieldTag, error)

func (*FieldTag) Clone

func (f *FieldTag) Clone() *FieldTag

func (*FieldTag) Tags

func (f *FieldTag) Tags() TagList

func (*FieldTag) Type

func (*FieldTag) Type() value.Type

func (*FieldTag) TypeProperty

func (f *FieldTag) TypeProperty() *TypeProperty

func (*FieldTag) Validate

func (f *FieldTag) Validate(v *value.Value) (err error)

func (*FieldTag) ValidateMultiple

func (f *FieldTag) ValidateMultiple(v *value.Multiple) (err error)

type FieldText

type FieldText struct {
	// contains filtered or unexported fields
}

func NewText

func NewText(maxLength *int) *FieldText

func (*FieldText) Clone

func (f *FieldText) Clone() *FieldText

func (*FieldText) MaxLength

func (f *FieldText) MaxLength() *int

func (*FieldText) Type

func (f *FieldText) Type() value.Type

func (*FieldText) TypeProperty

func (f *FieldText) TypeProperty() *TypeProperty

func (*FieldText) Validate

func (f *FieldText) Validate(v *value.Value) error

func (*FieldText) ValidateMultiple

func (f *FieldText) ValidateMultiple(v *value.Multiple) error

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) Validate

func (f *FieldTextArea) Validate(v *value.Value) error

func (*FieldTextArea) ValidateMultiple

func (f *FieldTextArea) ValidateMultiple(v *value.Multiple) error

type FieldURL

type FieldURL struct {
}

func NewURL

func NewURL() *FieldURL

func (*FieldURL) Clone

func (f *FieldURL) Clone() *FieldURL

func (*FieldURL) Type

func (*FieldURL) Type() value.Type

func (*FieldURL) TypeProperty

func (f *FieldURL) TypeProperty() *TypeProperty

func (*FieldURL) Validate

func (f *FieldURL) Validate(v *value.Value) (err error)

func (*FieldURL) ValidateMultiple

func (f *FieldURL) ValidateMultiple(v *value.Multiple) (err error)

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

type GeometryEditorSupportedTypeList

type GeometryEditorSupportedTypeList []GeometryEditorSupportedType

func (GeometryEditorSupportedTypeList) Has

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

type GeometryObjectSupportedTypeList

type GeometryObjectSupportedTypeList []GeometryObjectSupportedType

func (GeometryObjectSupportedTypeList) Has

type GroupID

type GroupID = id.GroupID

type GroupIDList

type GroupIDList = id.GroupIDList

type ID

type ID = id.SchemaID

type IDList

type IDList = id.SchemaIDList

type List

type List []*Schema

func (List) Clone

func (l List) Clone() List

func (List) Fields

func (l List) Fields() FieldList

func (List) Schema

func (l List) Schema(sID *id.SchemaID) *Schema

func (List) SortByID

func (l List) SortByID() List

type Package

type Package struct {
	// contains filtered or unexported fields
}

func NewPackage

func NewPackage(s *Schema, meta *Schema, groupSchemas map[id.GroupID]*Schema, referencedSchemas List) *Package

func (*Package) Field

func (p *Package) Field(fieldID id.FieldID) *Field

func (*Package) FieldByIDOrKey

func (p *Package) FieldByIDOrKey(fID *id.FieldID, k *id.Key) *Field

func (*Package) GroupSchema

func (p *Package) GroupSchema(gid id.GroupID) *Schema

func (*Package) GroupSchemas

func (p *Package) GroupSchemas() List

func (*Package) MetaSchema

func (p *Package) MetaSchema() *Schema

func (*Package) ReferencedSchema

func (p *Package) ReferencedSchema(fieldID id.FieldID) *Schema

func (*Package) ReferencedSchemas

func (p *Package) ReferencedSchemas() List

func (*Package) Schema

func (p *Package) Schema() *Schema

type ProjectID

type ProjectID = id.ProjectID

type Schema

type Schema struct {
	// contains filtered or unexported fields
}

func (*Schema) AddField

func (s *Schema) AddField(f *Field)

func (*Schema) Clone

func (s *Schema) Clone() *Schema

func (*Schema) Field

func (s *Schema) Field(fId FieldID) *Field

func (*Schema) FieldByIDOrKey

func (s *Schema) FieldByIDOrKey(fId *FieldID, key *key.Key) *Field

func (*Schema) Fields

func (s *Schema) Fields() FieldList

func (*Schema) FieldsByType

func (s *Schema) FieldsByType(t value.Type) FieldList

func (*Schema) Groups

func (s *Schema) Groups() GroupIDList

func (*Schema) HasField

func (s *Schema) HasField(f FieldID) bool

func (*Schema) HasFieldByKey

func (s *Schema) HasFieldByKey(k string) bool

func (*Schema) HasGeometryFields

func (s *Schema) HasGeometryFields() bool

func (*Schema) ID

func (s *Schema) ID() ID

func (*Schema) IsPointFieldSupported

func (s *Schema) IsPointFieldSupported() bool

func (*Schema) Project

func (s *Schema) Project() ProjectID

func (*Schema) ReferencedSchemas

func (s *Schema) ReferencedSchemas() IDList

func (*Schema) RemoveField

func (s *Schema) RemoveField(fid FieldID)

func (*Schema) SetTitleField

func (s *Schema) SetTitleField(tf *FieldID) error

func (*Schema) SetWorkspace

func (s *Schema) SetWorkspace(workspace accountdomain.WorkspaceID)

func (*Schema) TitleField

func (s *Schema) TitleField() *FieldID

func (*Schema) Workspace

func (s *Schema) Workspace() accountdomain.WorkspaceID

type Tag

type Tag struct {
	// contains filtered or unexported fields
}

func NewTag

func NewTag(name string, color TagColor) *Tag

func NewTagWithID

func NewTagWithID(tid TagID, name string, color TagColor) (*Tag, error)

func (*Tag) Color

func (t *Tag) Color() TagColor

func (*Tag) ID

func (t *Tag) ID() TagID

func (*Tag) Name

func (t *Tag) Name() string

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

func TagColorFrom(s string) TagColor

func (TagColor) String

func (s TagColor) String() string

type TagID

type TagID = id.TagID

type TagIDList

type TagIDList = id.TagIDList

type TagList

type TagList []*Tag

func (TagList) FindByID

func (tl TagList) FindByID(tid TagID) *Tag

func (TagList) FindByName

func (tl TagList) FindByName(name string) *Tag

func (TagList) HasDuplication

func (tl TagList) HasDuplication() bool

func (TagList) HasTag

func (tl TagList) HasTag(tid TagID) bool

func (TagList) IDs

func (tl TagList) IDs() TagIDList

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) Validate

func (t *TypeProperty) Validate(v *value.Value) error

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)
	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
	Default        func() T
}

type WorkspaceID

type WorkspaceID = id.WorkspaceID

Jump to

Keyboard shortcuts

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