Documentation ¶
Index ¶
- Variables
- type Builder
- type Camera
- type Condition
- type Coordinates
- type DatasetFieldID
- type DatasetID
- type DatasetMigrationParam
- type DatasetSchemaID
- type Field
- func (p *Field) ActualValue(ds *dataset.Dataset) *Value
- func (p *Field) Cast(t ValueType)
- func (p *Field) Clone() *Field
- func (p *Field) DatasetValue(ctx context.Context, d dataset.GraphLoader) (*dataset.Value, error)
- func (p *Field) Datasets() []DatasetID
- func (p *Field) Field() FieldID
- func (p *Field) IsDatasetLinked(s DatasetSchemaID, i DatasetID) bool
- func (p *Field) IsEmpty() bool
- func (p *Field) Link(links *Links)
- func (p *Field) Links() *Links
- func (p *Field) MigrateDataset(q DatasetMigrationParam)
- func (p *Field) MigrateSchema(ctx context.Context, newSchema *Schema, dl dataset.Loader) bool
- func (p *Field) Type() ValueType
- func (p *Field) Unlink()
- func (p *Field) Update(value *Value, field *SchemaField) error
- func (p *Field) UpdateField(field FieldID)
- func (p *Field) UpdateUnsafe(value *Value)
- func (p *Field) ValidateSchema(ps *SchemaField) error
- func (p *Field) Value() *Value
- type FieldBuilder
- func (b *FieldBuilder) Build() *Field
- func (b *FieldBuilder) Field(field FieldID) *FieldBuilder
- func (b *FieldBuilder) Links(l *Links) *FieldBuilder
- func (b *FieldBuilder) MustBuild() *Field
- func (b *FieldBuilder) Type(t ValueType) *FieldBuilder
- func (b *FieldBuilder) Value(v *OptionalValue) *FieldBuilder
- type FieldID
- type Group
- func (g *Group) Datasets() []DatasetID
- func (g *Group) Field(fid FieldID) *Field
- func (g *Group) FieldIDs() []FieldID
- func (g *Group) Fields() []*Field
- func (g *Group) FieldsByLinkedDataset(s DatasetSchemaID, i DatasetID) []*Field
- func (g *Group) GetOrCreateField(ps *Schema, fid FieldID) (*Field, bool)
- func (g *Group) HasLinkedField() bool
- func (g *Group) ID() ItemID
- func (g *Group) IDRef() *ItemID
- func (g *Group) IsDatasetLinked(s DatasetSchemaID, i DatasetID) bool
- func (g *Group) IsEmpty() bool
- func (g *Group) MigrateDataset(q DatasetMigrationParam)
- func (g *Group) MigrateSchema(ctx context.Context, newSchema *Schema, dl dataset.Loader)
- func (g *Group) Prune()
- func (g *Group) RemoveField(fid FieldID)
- func (g *Group) RepresentativeField(schema *Schema) *Field
- func (g *Group) SchemaGroup() SchemaGroupID
- func (g *Group) SchemaGroupRef() *SchemaGroupID
- func (p *Group) ValidateSchema(ps *SchemaGroup) error
- type GroupBuilder
- func (b *GroupBuilder) Build() (*Group, error)
- func (b *GroupBuilder) Fields(fields []*Field) *GroupBuilder
- func (b *GroupBuilder) ID(id ItemID) *GroupBuilder
- func (b *GroupBuilder) MustBuild() *Group
- func (b *GroupBuilder) NewID() *GroupBuilder
- func (b *GroupBuilder) SchemaGroup(g SchemaGroupID) *GroupBuilder
- type GroupList
- func (g *GroupList) Add(gg *Group, index int)
- func (g *GroupList) AddOrMove(gg *Group, index int)
- func (g *GroupList) Count() int
- func (g *GroupList) CreateAndAddListItem(ps *Schema, index *int) *Group
- func (g *GroupList) Datasets() []DatasetID
- func (g *GroupList) Empty()
- func (g *GroupList) FieldsByLinkedDataset(s DatasetSchemaID, i DatasetID) []*Field
- func (g *GroupList) GetOrCreateField(ps *Schema, ptr *Pointer) (*Field, bool)
- func (g *GroupList) Group(gid ItemID) *Group
- func (g *GroupList) GroupAt(i int) *Group
- func (g *GroupList) Groups() []*Group
- func (g *GroupList) Has(i ItemID) bool
- func (g *GroupList) HasLinkedField() bool
- func (g *GroupList) ID() ItemID
- func (g *GroupList) IDRef() *ItemID
- func (g *GroupList) IsDatasetLinked(s DatasetSchemaID, i DatasetID) bool
- func (g *GroupList) IsEmpty() bool
- func (g *GroupList) MigrateDataset(q DatasetMigrationParam)
- func (g *GroupList) MigrateSchema(ctx context.Context, newSchema *Schema, dl dataset.Loader)
- func (g *GroupList) Move(id ItemID, toIndex int)
- func (g *GroupList) MoveAt(fromIndex int, toIndex int)
- func (g *GroupList) Prune()
- func (g *GroupList) Remove(id ItemID) bool
- func (g *GroupList) RemoveAt(index int)
- func (g *GroupList) SchemaGroup() SchemaGroupID
- func (g *GroupList) SchemaGroupRef() *SchemaGroupID
- func (p *GroupList) ValidateSchema(ps *SchemaGroup) error
- type GroupListBuilder
- func (b *GroupListBuilder) Build() (*GroupList, error)
- func (b *GroupListBuilder) Groups(fields []*Group) *GroupListBuilder
- func (b *GroupListBuilder) ID(id ItemID) *GroupListBuilder
- func (b *GroupListBuilder) MustBuild() *GroupList
- func (b *GroupListBuilder) NewID() *GroupListBuilder
- func (b *GroupListBuilder) SchemaGroup(g SchemaGroupID) *GroupListBuilder
- type ID
- type IDSet
- type Initializer
- type InitializerField
- type InitializerGroup
- type InitializerItem
- type InitializerLink
- type Item
- type ItemBuilder
- type ItemID
- type ItemIDSet
- type LatLng
- type LatLngHeight
- type Link
- func (l *Link) ApplyDataset(ds *DatasetID) *Link
- func (l *Link) Clone() *Link
- func (l *Link) Dataset() *DatasetID
- func (l *Link) DatasetSchema() *DatasetSchemaID
- func (l *Link) DatasetSchemaField() *DatasetFieldID
- func (l *Link) Validate(dss *dataset.Schema, ds *dataset.Dataset) bool
- func (l *Link) Value(ds *dataset.Dataset) *dataset.Value
- type LinkableFields
- type Links
- func (l *Links) ApplyDataset(ds *DatasetID) *Links
- func (l *Links) Clone() *Links
- func (l *Links) DatasetIDs() []DatasetID
- func (l *Links) DatasetSchemaFieldIDs() []DatasetFieldID
- func (l *Links) DatasetSchemaIDs() []DatasetSchemaID
- func (l *Links) DatasetValue(ctx context.Context, d dataset.GraphLoader) (*dataset.Value, error)
- func (l *Links) First() *Link
- func (l *Links) HasDataset(did DatasetID) bool
- func (l *Links) HasDatasetSchema(dsid DatasetSchemaID) bool
- func (l *Links) HasDatasetSchemaAndDataset(dsid DatasetSchemaID, did DatasetID) bool
- func (l *Links) HasSchemaAndDataset(s DatasetSchemaID, dsid DatasetID) bool
- func (l *Links) IsEmpty() bool
- func (l *Links) IsLinked() bool
- func (l *Links) IsLinkedFully() bool
- func (l *Links) Last() *Link
- func (l *Links) LastValue(ds *dataset.Dataset) *dataset.Value
- func (l *Links) Len() int
- func (l *Links) Links() []*Link
- func (l *Links) Replace(dsm map[DatasetSchemaID]DatasetSchemaID, dm map[DatasetID]DatasetID, ...)
- func (l *Links) Validate(dsm dataset.SchemaMap, dm dataset.Map) bool
- type List
- type Loader
- type Map
- type Merged
- type MergedField
- type MergedGroup
- type MergedMetadata
- type MigrationPlan
- type Migrator
- type OptionalValue
- type Pointer
- func NewPointer(sg *SchemaGroupID, i *ItemID, f *FieldID) *Pointer
- func PointField(sg *SchemaGroupID, i *ItemID, f FieldID) *Pointer
- func PointFieldByItem(i ItemID, f FieldID) *Pointer
- func PointFieldBySchemaGroup(sg SchemaGroupID, f FieldID) *Pointer
- func PointFieldOnly(fid FieldID) *Pointer
- func PointItem(i ItemID) *Pointer
- func PointItemBySchema(sg SchemaGroupID) *Pointer
- func (p *Pointer) Clone() *Pointer
- func (p *Pointer) Field() (f FieldID, ok bool)
- func (p *Pointer) FieldByItem() (i ItemID, f FieldID, ok bool)
- func (p *Pointer) FieldBySchemaGroup() (sg SchemaGroupID, f FieldID, ok bool)
- func (p *Pointer) FieldRef() *FieldID
- func (p *Pointer) GetAll() (sg *SchemaGroupID, i *ItemID, f *FieldID)
- func (p *Pointer) Item() (i ItemID, ok bool)
- func (p *Pointer) ItemBySchemaGroup() (i SchemaGroupID, ok bool)
- func (p *Pointer) ItemBySchemaGroupAndItem() (i SchemaGroupID, i2 ItemID, ok bool)
- func (p *Pointer) ItemRef() *ItemID
- func (p *Pointer) SchemaGroupAndItem() (i SchemaGroupID, i2 ItemID, ok bool)
- type Polygon
- type Property
- func (p *Property) AddListItem(ps *Schema, ptr *Pointer, index *int) (*Group, *GroupList)
- func (p *Property) AutoLinkField(s *Schema, v ValueType, d DatasetSchemaID, df *DatasetFieldID, ds *DatasetID)
- func (p *Property) Datasets() []DatasetID
- func (p *Property) Field(ptr *Pointer) (*Field, *GroupList, *Group)
- func (p *Property) FieldsByLinkedDataset(s DatasetSchemaID, i DatasetID) []*Field
- func (p *Property) GetOrCreateField(ps *Schema, ptr *Pointer) (*Field, *GroupList, *Group, bool)
- func (p *Property) GetOrCreateGroup(ps *Schema, ptr *Pointer) (*Group, *GroupList)
- func (p *Property) GetOrCreateGroupList(ps *Schema, ptr *Pointer) *GroupList
- func (p *Property) GetOrCreateItem(ps *Schema, ptr *Pointer) (Item, *GroupList)
- func (p *Property) GroupBySchema(id SchemaGroupID) *Group
- func (p *Property) GroupListBySchema(id SchemaGroupID) *GroupList
- func (p *Property) HasLinkedField() bool
- func (p *Property) ID() ID
- func (p *Property) IDRef() *ID
- func (p *Property) IsDatasetLinked(s DatasetSchemaID, i DatasetID) bool
- func (p *Property) Item(id ItemID) (Item, *GroupList)
- func (p *Property) ItemByPointer(ptr *Pointer) (Item, *GroupList)
- func (p *Property) ItemBySchema(id SchemaGroupID) Item
- func (p *Property) Items() []Item
- func (p *Property) ListItem(ptr *Pointer) (*Group, *GroupList)
- func (p *Property) MigrateDataset(q DatasetMigrationParam)
- func (p *Property) MigrateSchema(ctx context.Context, newSchema *Schema, dl dataset.Loader)
- func (p *Property) MoveListItem(ptr *Pointer, i int) (*Group, *GroupList)
- func (p *Property) Prune()
- func (p *Property) RemoveField(ptr *Pointer)
- func (p *Property) RemoveItem(ptr *Pointer)
- func (p *Property) RemoveListItem(ptr *Pointer) bool
- func (p *Property) Scene() SceneID
- func (p *Property) Schema() SchemaID
- func (p *Property) UnlinkAllByDataset(s DatasetSchemaID, ds DatasetID)
- func (p *Property) UpdateLinkableValue(s *Schema, v *Value)
- func (p *Property) UpdateValue(ps *Schema, ptr *Pointer, v *Value) (*Field, *GroupList, *Group, error)
- func (p *Property) ValidateSchema(ps *Schema) error
- type Rect
- type SceneID
- type Schema
- func (s *Schema) DetectDuplicatedFields() []FieldID
- func (p *Schema) Field(id FieldID) *SchemaField
- func (p *Schema) FieldByPointer(ptr *Pointer) *SchemaField
- func (p *Schema) Fields() []*SchemaField
- func (p *Schema) Group(id SchemaGroupID) *SchemaGroup
- func (p *Schema) GroupByField(id FieldID) *SchemaGroup
- func (p *Schema) GroupByPointer(ptr *Pointer) *SchemaGroup
- func (p *Schema) Groups() []*SchemaGroup
- func (p *Schema) ID() SchemaID
- func (p *Schema) IDRef() *SchemaID
- func (p *Schema) LinkableFields() LinkableFields
- func (p *Schema) Version() int
- type SchemaBuilder
- func (b *SchemaBuilder) Build() (*Schema, error)
- func (b *SchemaBuilder) Groups(groups []*SchemaGroup) *SchemaBuilder
- func (b *SchemaBuilder) ID(id SchemaID) *SchemaBuilder
- func (b *SchemaBuilder) LinkableFields(l LinkableFields) *SchemaBuilder
- func (b *SchemaBuilder) MustBuild() *Schema
- func (b *SchemaBuilder) Version(version int) *SchemaBuilder
- type SchemaField
- func (p *SchemaField) Choice(key string) *SchemaFieldChoice
- func (p *SchemaField) Choices() []SchemaFieldChoice
- func (p *SchemaField) DefaultValue() *Value
- func (p *SchemaField) Description() i18n.String
- func (p *SchemaField) ID() FieldID
- func (p *SchemaField) IsAvailableIf() *Condition
- func (p *SchemaField) Max() *float64
- func (p *SchemaField) Min() *float64
- func (p *SchemaField) MinMax() (*float64, *float64)
- func (p *SchemaField) Prefix() string
- func (p *SchemaField) SetDescription(des i18n.String)
- func (p *SchemaField) SetTitle(title i18n.String)
- func (p *SchemaField) Suffix() string
- func (p *SchemaField) Title() i18n.String
- func (p *SchemaField) Type() ValueType
- func (p *SchemaField) UI() *SchemaFieldUI
- func (p *SchemaField) Validate(value *OptionalValue) bool
- type SchemaFieldBuilder
- func (b *SchemaFieldBuilder) Build() (*SchemaField, error)
- func (b *SchemaFieldBuilder) Choices(choices []SchemaFieldChoice) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) DefaultValue(v *Value) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) Description(description i18n.String) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) ID(id FieldID) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) IsAvailableIf(cond *Condition) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) Max(max float64) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) MaxRef(max *float64) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) Min(min float64) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) MinRef(min *float64) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) MustBuild() *SchemaField
- func (b *SchemaFieldBuilder) Name(name i18n.String) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) Prefix(prefix string) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) Suffix(suffix string) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) Type(propertyType ValueType) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) UI(ui SchemaFieldUI) *SchemaFieldBuilder
- func (b *SchemaFieldBuilder) UIRef(ui *SchemaFieldUI) *SchemaFieldBuilder
- type SchemaFieldChoice
- type SchemaFieldUI
- type SchemaGroup
- func (s *SchemaGroup) Field(fid FieldID) *SchemaField
- func (s *SchemaGroup) FieldByPointer(ptr *Pointer) *SchemaField
- func (s *SchemaGroup) Fields() []*SchemaField
- func (s *SchemaGroup) HasField(i FieldID) bool
- func (s *SchemaGroup) ID() SchemaGroupID
- func (s *SchemaGroup) IDRef() *SchemaGroupID
- func (s *SchemaGroup) IsAvailableIf() *Condition
- func (s *SchemaGroup) IsList() bool
- func (s *SchemaGroup) RepresentativeField() *SchemaField
- func (s *SchemaGroup) RepresentativeFieldID() *FieldID
- func (s *SchemaGroup) SetTitle(t i18n.String)
- func (s *SchemaGroup) Title() i18n.String
- type SchemaGroupBuilder
- func (b *SchemaGroupBuilder) Build() (*SchemaGroup, error)
- func (b *SchemaGroupBuilder) Fields(fields []*SchemaField) *SchemaGroupBuilder
- func (b *SchemaGroupBuilder) ID(id SchemaGroupID) *SchemaGroupBuilder
- func (b *SchemaGroupBuilder) IsAvailableIf(cond *Condition) *SchemaGroupBuilder
- func (b *SchemaGroupBuilder) IsList(list bool) *SchemaGroupBuilder
- func (b *SchemaGroupBuilder) MustBuild() *SchemaGroup
- func (b *SchemaGroupBuilder) RepresentativeField(representativeField *FieldID) *SchemaGroupBuilder
- func (b *SchemaGroupBuilder) Title(title i18n.String) *SchemaGroupBuilder
- type SchemaGroupID
- type SchemaID
- type SchemaList
- type SchemaLoader
- type SchemaMap
- type Sealed
- func (s *Sealed) Field(id FieldID) *SealedField
- func (s *Sealed) FieldBy(ptr *Pointer) *SealedField
- func (s *Sealed) Interface() map[string]interface{}
- func (s *Sealed) Item(i ItemID) *SealedItem
- func (s *Sealed) ItemBy(ptr *Pointer) *SealedItem
- func (s *Sealed) ItemBySchemaGroup(i SchemaGroupID) *SealedItem
- type SealedField
- type SealedItem
- type TextAlign
- type Typography
- type Validator
- type Value
- func (v *Value) Cast(vt ValueType) *Value
- func (v *Value) Clone() *Value
- func (v *Value) Interface() interface{}
- func (v *Value) IsEmpty() bool
- func (v *Value) Some() *OptionalValue
- func (v *Value) Type() ValueType
- func (v *Value) Value() interface{}
- func (v *Value) ValueBool() *bool
- func (v *Value) ValueCamera() (vv Camera, ok bool)
- func (v *Value) ValueCoordinates() *Coordinates
- func (v *Value) ValueLatLng() *LatLng
- func (v *Value) ValueLatLngHeight() *LatLngHeight
- func (v *Value) ValueNumber() *float64
- func (v *Value) ValuePolygon() *Polygon
- func (v *Value) ValueRect() *Rect
- func (v *Value) ValueRef() *string
- func (v *Value) ValueString() *string
- func (v *Value) ValueTypography() (vv Typography, ok bool)
- func (v *Value) ValueURL() *url.URL
- type ValueAndDatasetValue
- type ValueType
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidPropertyValue = errors.New("invalid property value") ErrCannotLinkDataset = errors.New("cannot link dataset") ErrInvalidPropertyType = errors.New("invalid property type") ErrInvalidPropertyField = errors.New("invalid property field") )
var ( ErrInvalidSceneID = errors.New("invalid scene id") ErrInvalidPropertySchemaID = errors.New("invalid property schema id") ErrInvalidValue = errors.New("invalid value") ErrInvalidPropertyLinkableField = errors.New("invalid property linkable field") ErrInvalidVersion = errors.New("invalid version") ErrDuplicatedField = errors.New("duplicated field") )
var ( ValueTypeUnknown = ValueType(value.TypeUnknown) ValueTypeBool = ValueType(value.TypeBool) ValueTypeNumber = ValueType(value.TypeNumber) ValueTypeString = ValueType(value.TypeString) ValueTypeRef = ValueType(value.TypeRef) ValueTypeURL = ValueType(value.TypeURL) ValueTypeLatLng = ValueType(value.TypeLatLng) ValueTypeLatLngHeight = ValueType(value.TypeLatLngHeight) ValueTypeCoordinates = ValueType(value.TypeCoordinates) ValueTypePolygon = ValueType(value.TypePolygon) ValueTypeRect = ValueType(value.TypeRect) )
var DatasetFieldIDFrom = id.DatasetSchemaFieldIDFrom
var DatasetFieldIDFromRef = id.DatasetSchemaFieldIDFromRef
var DatasetFieldIDFromRefID = id.DatasetSchemaFieldIDFromRefID
var DatasetIDFrom = id.DatasetIDFrom
var DatasetIDFromRef = id.DatasetIDFromRef
var DatasetIDFromRefID = id.DatasetIDFromRefID
var DatasetSchemaIDFrom = id.DatasetSchemaIDFrom
var DatasetSchemaIDFromRef = id.DatasetSchemaIDFromRef
var DatasetSchemaIDFromRefID = id.DatasetSchemaIDFromRefID
var ErrInvalidID = id.ErrInvalidID
var ErrSchemaDoesNotMatch = errors.New("schema of the initializer does not match schema of the argument")
var FieldIDFrom = id.PropertySchemaFieldIDFrom
var IDFrom = id.PropertyIDFrom
var IDFromRef = id.PropertyIDFromRef
var IDFromRefID = id.PropertyIDFromRefID
var ItemIDFrom = id.PropertyItemIDFrom
var ItemIDFromRef = id.PropertyItemIDFromRef
var ItemIDFromRefID = id.PropertyItemIDFromRefID
var MustDatasetFieldID = id.MustDatasetSchemaFieldID
var MustDatasetID = id.MustDatasetID
var MustDatasetSchemaID = id.MustDatasetSchemaID
var MustID = id.MustPropertyID
var MustItemID = id.MustPropertyItemID
var MustSceneID = id.MustSceneID
var MustSchemaID = id.MustPropertySchemaID
var NewDatasetFieldID = id.NewDatasetSchemaFieldID
var NewDatasetID = id.NewDatasetID
var NewDatasetSchemaID = id.NewDatasetSchemaID
var NewID = id.NewPropertyID
var NewIDSet = id.NewPropertyIDSet
var NewItemID = id.NewPropertyItemID
var NewItemIDSet = id.NewPropertyItemIDSet
var NewSceneID = id.NewSceneID
var SceneIDFrom = id.SceneIDFrom
var SceneIDFromRef = id.SceneIDFromRef
var SceneIDFromRefID = id.SceneIDFromRefID
var SchemaGroupIDFrom = id.PropertySchemaGroupIDFrom
var SchemaIDFrom = id.PropertySchemaIDFrom
var SchemaIDFromRef = id.PropertySchemaIDFromRef
var ValueTypeCamera = ValueType("camera")
var ValueTypeTypography = ValueType("typography")
Functions ¶
This section is empty.
Types ¶
type Camera ¶
type Camera struct { Lat float64 `json:"lat" mapstructure:"lat"` Lng float64 `json:"lng" mapstructure:"lng"` Altitude float64 `json:"altitude" mapstructure:"altitude"` Heading float64 `json:"heading" mapstructure:"heading"` Pitch float64 `json:"pitch" mapstructure:"pitch"` Roll float64 `json:"roll" mapstructure:"roll"` FOV float64 `json:"fov" mapstructure:"fov"` }
type Coordinates ¶
type Coordinates = value.Coordinates
type DatasetFieldID ¶ added in v0.4.0
type DatasetFieldID = id.DatasetSchemaFieldID
type DatasetMigrationParam ¶
type DatasetMigrationParam struct { OldDatasetSchemaMap map[DatasetSchemaID]DatasetSchemaID OldDatasetMap map[DatasetID]DatasetID DatasetFieldIDMap map[DatasetFieldID]DatasetFieldID NewDatasetSchemaMap map[DatasetSchemaID]*dataset.Schema NewDatasetMap map[DatasetID]*dataset.Dataset }
type DatasetSchemaID ¶ added in v0.4.0
type DatasetSchemaID = id.DatasetSchemaID
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
func (*Field) DatasetValue ¶
func (*Field) IsDatasetLinked ¶
func (p *Field) IsDatasetLinked(s DatasetSchemaID, i DatasetID) bool
func (*Field) MigrateDataset ¶
func (p *Field) MigrateDataset(q DatasetMigrationParam)
func (*Field) MigrateSchema ¶
func (*Field) UpdateField ¶
func (*Field) UpdateUnsafe ¶
func (*Field) ValidateSchema ¶
func (p *Field) ValidateSchema(ps *SchemaField) error
type FieldBuilder ¶
type FieldBuilder struct {
// contains filtered or unexported fields
}
func FieldFrom ¶ added in v0.4.0
func FieldFrom(sf *SchemaField) *FieldBuilder
func NewField ¶
func NewField(field FieldID) *FieldBuilder
func (*FieldBuilder) Build ¶
func (b *FieldBuilder) Build() *Field
func (*FieldBuilder) Field ¶ added in v0.4.0
func (b *FieldBuilder) Field(field FieldID) *FieldBuilder
func (*FieldBuilder) Links ¶ added in v0.4.0
func (b *FieldBuilder) Links(l *Links) *FieldBuilder
func (*FieldBuilder) MustBuild ¶
func (b *FieldBuilder) MustBuild() *Field
func (*FieldBuilder) Type ¶ added in v0.4.0
func (b *FieldBuilder) Type(t ValueType) *FieldBuilder
func (*FieldBuilder) Value ¶
func (b *FieldBuilder) Value(v *OptionalValue) *FieldBuilder
type FieldID ¶ added in v0.4.0
type FieldID = id.PropertySchemaFieldID
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group represents a group of property
func InitGroupFrom ¶
func InitGroupFrom(g *SchemaGroup) *Group
func (*Group) FieldsByLinkedDataset ¶
func (g *Group) FieldsByLinkedDataset(s DatasetSchemaID, i DatasetID) []*Field
func (*Group) GetOrCreateField ¶
func (*Group) HasLinkedField ¶
func (*Group) IsDatasetLinked ¶
func (g *Group) IsDatasetLinked(s DatasetSchemaID, i DatasetID) bool
func (*Group) MigrateDataset ¶
func (g *Group) MigrateDataset(q DatasetMigrationParam)
func (*Group) MigrateSchema ¶
TODO: group migration
func (*Group) RemoveField ¶
func (*Group) RepresentativeField ¶ added in v0.4.0
func (*Group) SchemaGroup ¶
func (g *Group) SchemaGroup() SchemaGroupID
func (*Group) SchemaGroupRef ¶
func (g *Group) SchemaGroupRef() *SchemaGroupID
func (*Group) ValidateSchema ¶
func (p *Group) ValidateSchema(ps *SchemaGroup) error
type GroupBuilder ¶
type GroupBuilder struct {
// contains filtered or unexported fields
}
func NewGroup ¶
func NewGroup() *GroupBuilder
func (*GroupBuilder) Build ¶
func (b *GroupBuilder) Build() (*Group, error)
func (*GroupBuilder) Fields ¶
func (b *GroupBuilder) Fields(fields []*Field) *GroupBuilder
func (*GroupBuilder) ID ¶
func (b *GroupBuilder) ID(id ItemID) *GroupBuilder
func (*GroupBuilder) MustBuild ¶
func (b *GroupBuilder) MustBuild() *Group
func (*GroupBuilder) NewID ¶
func (b *GroupBuilder) NewID() *GroupBuilder
func (*GroupBuilder) SchemaGroup ¶ added in v0.4.0
func (b *GroupBuilder) SchemaGroup(g SchemaGroupID) *GroupBuilder
type GroupList ¶
type GroupList struct {
// contains filtered or unexported fields
}
func InitGroupListFrom ¶
func InitGroupListFrom(g *SchemaGroup) *GroupList
func ToGroupList ¶
func (*GroupList) CreateAndAddListItem ¶
func (*GroupList) FieldsByLinkedDataset ¶
func (g *GroupList) FieldsByLinkedDataset(s DatasetSchemaID, i DatasetID) []*Field
func (*GroupList) GetOrCreateField ¶
func (*GroupList) HasLinkedField ¶
func (*GroupList) IsDatasetLinked ¶
func (g *GroupList) IsDatasetLinked(s DatasetSchemaID, i DatasetID) bool
func (*GroupList) MigrateDataset ¶
func (g *GroupList) MigrateDataset(q DatasetMigrationParam)
func (*GroupList) MigrateSchema ¶
func (*GroupList) SchemaGroup ¶
func (g *GroupList) SchemaGroup() SchemaGroupID
SchemaGroup returns id of schema group
func (*GroupList) SchemaGroupRef ¶
func (g *GroupList) SchemaGroupRef() *SchemaGroupID
func (*GroupList) ValidateSchema ¶
func (p *GroupList) ValidateSchema(ps *SchemaGroup) error
type GroupListBuilder ¶
type GroupListBuilder struct {
// contains filtered or unexported fields
}
func NewGroupList ¶
func NewGroupList() *GroupListBuilder
func (*GroupListBuilder) Build ¶
func (b *GroupListBuilder) Build() (*GroupList, error)
func (*GroupListBuilder) Groups ¶
func (b *GroupListBuilder) Groups(fields []*Group) *GroupListBuilder
func (*GroupListBuilder) ID ¶
func (b *GroupListBuilder) ID(id ItemID) *GroupListBuilder
func (*GroupListBuilder) MustBuild ¶
func (b *GroupListBuilder) MustBuild() *GroupList
func (*GroupListBuilder) NewID ¶
func (b *GroupListBuilder) NewID() *GroupListBuilder
func (*GroupListBuilder) SchemaGroup ¶ added in v0.4.0
func (b *GroupListBuilder) SchemaGroup(g SchemaGroupID) *GroupListBuilder
type ID ¶ added in v0.4.0
type ID = id.PropertyID
type IDSet ¶ added in v0.4.0
type IDSet = id.PropertyIDSet
type Initializer ¶
type Initializer struct { ID *ID `json:"id"` Schema SchemaID `json:"schema"` Items []*InitializerItem `json:"items"` }
func (*Initializer) Clone ¶
func (p *Initializer) Clone() *Initializer
func (*Initializer) MustBeProperty ¶
func (p *Initializer) MustBeProperty(scene SceneID) *Property
func (*Initializer) PropertyIncludingEmpty ¶
func (p *Initializer) PropertyIncludingEmpty(scene SceneID, schema SchemaID) (*Property, error)
PropertyIncludingEmpty generates a new property, but even if the initializer is empty, an empty property will be generated.
type InitializerField ¶
type InitializerField struct { Field FieldID `json:"field"` Type ValueType `json:"type"` Value *Value `json:"value"` Links []*InitializerLink `json:"links"` }
func (*InitializerField) Clone ¶
func (p *InitializerField) Clone() *InitializerField
func (*InitializerField) PropertyField ¶
func (p *InitializerField) PropertyField() *Field
type InitializerGroup ¶
type InitializerGroup struct { ID *ItemID `json:"id"` Fields []*InitializerField `json:"fields"` }
func (*InitializerGroup) Clone ¶
func (p *InitializerGroup) Clone() *InitializerGroup
func (*InitializerGroup) PropertyGroup ¶
func (p *InitializerGroup) PropertyGroup(parentItem SchemaGroupID) (*Group, error)
type InitializerItem ¶
type InitializerItem struct { ID *ItemID `json:"id"` SchemaItem SchemaGroupID `json:"schemaItem"` Groups []*InitializerGroup `json:"groups"` Fields []*InitializerField `json:"fields"` }
func (*InitializerItem) Clone ¶
func (p *InitializerItem) Clone() *InitializerItem
func (*InitializerItem) PropertyGroup ¶
func (p *InitializerItem) PropertyGroup() *Group
func (*InitializerItem) PropertyGroupList ¶
func (p *InitializerItem) PropertyGroupList() *GroupList
func (*InitializerItem) PropertyItem ¶
func (p *InitializerItem) PropertyItem() (Item, error)
type InitializerLink ¶
type InitializerLink struct { Dataset *DatasetID `json:"dataset"` Schema DatasetSchemaID `json:"schema"` Field DatasetFieldID `json:"field"` }
func (*InitializerLink) Clone ¶
func (p *InitializerLink) Clone() *InitializerLink
func (*InitializerLink) PropertyLink ¶
func (p *InitializerLink) PropertyLink() *Link
type Item ¶
type Item interface { ID() ItemID IDRef() *ItemID SchemaGroup() SchemaGroupID SchemaGroupRef() *SchemaGroupID HasLinkedField() bool Datasets() []DatasetID FieldsByLinkedDataset(DatasetSchemaID, DatasetID) []*Field IsDatasetLinked(DatasetSchemaID, DatasetID) bool IsEmpty() bool Prune() MigrateSchema(context.Context, *Schema, dataset.Loader) MigrateDataset(DatasetMigrationParam) ValidateSchema(*SchemaGroup) error }
func InitItemFrom ¶
func InitItemFrom(psg *SchemaGroup) Item
type ItemBuilder ¶
type ItemBuilder struct {
// contains filtered or unexported fields
}
func NewItem ¶
func NewItem() *ItemBuilder
func (*ItemBuilder) Group ¶
func (b *ItemBuilder) Group() *GroupBuilder
func (*ItemBuilder) GroupList ¶
func (b *ItemBuilder) GroupList() *GroupListBuilder
func (*ItemBuilder) ID ¶
func (b *ItemBuilder) ID(id ItemID) *ItemBuilder
func (*ItemBuilder) NewID ¶
func (b *ItemBuilder) NewID() *ItemBuilder
func (*ItemBuilder) SchemaGroup ¶ added in v0.4.0
func (b *ItemBuilder) SchemaGroup(g SchemaGroupID) *ItemBuilder
type ItemID ¶ added in v0.4.0
type ItemID = id.PropertyItemID
type ItemIDSet ¶ added in v0.4.0
type ItemIDSet = id.PropertyItemIDSet
type LatLngHeight ¶
type LatLngHeight = value.LatLngHeight
type Link ¶
type Link struct {
// contains filtered or unexported fields
}
func NewLink ¶
func NewLink(d DatasetID, ds DatasetSchemaID, f DatasetFieldID) *Link
func NewLinkFieldOnly ¶
func NewLinkFieldOnly(ds DatasetSchemaID, f DatasetFieldID) *Link
func (*Link) ApplyDataset ¶
func (*Link) DatasetSchema ¶
func (l *Link) DatasetSchema() *DatasetSchemaID
func (*Link) DatasetSchemaField ¶
func (l *Link) DatasetSchemaField() *DatasetFieldID
type LinkableFields ¶
func (LinkableFields) Clone ¶
func (l LinkableFields) Clone() LinkableFields
func (LinkableFields) Validate ¶
func (l LinkableFields) Validate(s *Schema) bool
type Links ¶
type Links struct {
// contains filtered or unexported fields
}
func (*Links) ApplyDataset ¶
func (*Links) DatasetIDs ¶
func (*Links) DatasetSchemaFieldIDs ¶
func (l *Links) DatasetSchemaFieldIDs() []DatasetFieldID
func (*Links) DatasetSchemaIDs ¶
func (l *Links) DatasetSchemaIDs() []DatasetSchemaID
func (*Links) DatasetValue ¶
func (*Links) HasDataset ¶
func (*Links) HasDatasetSchema ¶
func (l *Links) HasDatasetSchema(dsid DatasetSchemaID) bool
func (*Links) HasDatasetSchemaAndDataset ¶ added in v0.4.0
func (l *Links) HasDatasetSchemaAndDataset(dsid DatasetSchemaID, did DatasetID) bool
func (*Links) HasSchemaAndDataset ¶ added in v0.4.0
func (l *Links) HasSchemaAndDataset(s DatasetSchemaID, dsid DatasetID) bool
func (*Links) IsLinkedFully ¶
func (*Links) Replace ¶
func (l *Links) Replace( dsm map[DatasetSchemaID]DatasetSchemaID, dm map[DatasetID]DatasetID, fm map[DatasetFieldID]DatasetFieldID, )
type Merged ¶
type Merged struct { Original *ID Parent *ID Schema SchemaID LinkedDataset *DatasetID Groups []*MergedGroup }
Merged represents a merged property from two properties
type MergedField ¶
MergedField represents a field of Merged
func (*MergedField) DatasetValue ¶
func (f *MergedField) DatasetValue(ctx context.Context, d dataset.GraphLoader) (*dataset.Value, error)
type MergedGroup ¶
type MergedGroup struct { Original *ItemID Parent *ItemID SchemaGroup SchemaGroupID LinkedDataset *DatasetID Groups []*MergedGroup Fields []*MergedField }
MergedGroup represents a group of Merged
func (*MergedGroup) Datasets ¶
func (m *MergedGroup) Datasets() []DatasetID
Datasets returns associated dataset IDs
type MergedMetadata ¶
func MergedMetadataFrom ¶
func MergedMetadataFrom(p ID) MergedMetadata
MergedMetadataFrom generates MergedMetadata from single property
func (MergedMetadata) Merge ¶
func (m MergedMetadata) Merge(o *Property, p *Property) *Merged
Merge merges two properties
func (MergedMetadata) Properties ¶
func (m MergedMetadata) Properties() []ID
Properties returns associated property IDs
type MigrationPlan ¶ added in v0.2.0
type Migrator ¶ added in v0.2.0
type Migrator struct { NewSchema *Schema Plans []MigrationPlan }
type OptionalValue ¶ added in v0.3.0
type OptionalValue struct {
// contains filtered or unexported fields
}
func NewOptionalValue ¶ added in v0.3.0
func NewOptionalValue(t ValueType, v *Value) *OptionalValue
func OptionalValueFrom ¶ added in v0.3.0
func OptionalValueFrom(v *Value) *OptionalValue
func (*OptionalValue) Cast ¶ added in v0.3.0
func (ov *OptionalValue) Cast(t ValueType) *OptionalValue
func (*OptionalValue) Clone ¶ added in v0.3.0
func (ov *OptionalValue) Clone() *OptionalValue
func (*OptionalValue) SetValue ¶ added in v0.3.0
func (ov *OptionalValue) SetValue(v *Value)
func (*OptionalValue) Type ¶ added in v0.3.0
func (ov *OptionalValue) Type() ValueType
func (*OptionalValue) TypeAndValue ¶ added in v0.3.0
func (ov *OptionalValue) TypeAndValue() (ValueType, *Value)
func (*OptionalValue) Value ¶ added in v0.3.0
func (ov *OptionalValue) Value() *Value
type Pointer ¶
type Pointer struct {
// contains filtered or unexported fields
}
Pointer is a pointer to a field and an item in properties and schemas
func NewPointer ¶
func NewPointer(sg *SchemaGroupID, i *ItemID, f *FieldID) *Pointer
NewPointer creates a new Pointer.
func PointField ¶
func PointField(sg *SchemaGroupID, i *ItemID, f FieldID) *Pointer
PointField creates a new Pointer pointing the field in properties.
func PointFieldByItem ¶
PointFieldByItem creates a new Pointer pointing to the field of the item in properties.
func PointFieldBySchemaGroup ¶
func PointFieldBySchemaGroup(sg SchemaGroupID, f FieldID) *Pointer
PointFieldBySchemaGroup creates a new Pointer pointing to the field of the schema field in properties.
func PointFieldOnly ¶
PointField creates a new Pointer pointing the field in property schemas.
func PointItemBySchema ¶
func PointItemBySchema(sg SchemaGroupID) *Pointer
PointItemBySchema creates a new Pointer pointing the schema item in property schemas.
func (*Pointer) FieldBySchemaGroup ¶
func (p *Pointer) FieldBySchemaGroup() (sg SchemaGroupID, f FieldID, ok bool)
func (*Pointer) ItemBySchemaGroup ¶
func (p *Pointer) ItemBySchemaGroup() (i SchemaGroupID, ok bool)
func (*Pointer) ItemBySchemaGroupAndItem ¶
func (p *Pointer) ItemBySchemaGroupAndItem() (i SchemaGroupID, i2 ItemID, ok bool)
func (*Pointer) SchemaGroupAndItem ¶
func (p *Pointer) SchemaGroupAndItem() (i SchemaGroupID, i2 ItemID, ok bool)
type Property ¶
type Property struct {
// contains filtered or unexported fields
}
func (*Property) AddListItem ¶
func (*Property) AutoLinkField ¶
func (p *Property) AutoLinkField(s *Schema, v ValueType, d DatasetSchemaID, df *DatasetFieldID, ds *DatasetID)
func (*Property) FieldsByLinkedDataset ¶
func (p *Property) FieldsByLinkedDataset(s DatasetSchemaID, i DatasetID) []*Field
func (*Property) GetOrCreateField ¶
func (*Property) GetOrCreateGroup ¶
func (*Property) GetOrCreateGroupList ¶
func (*Property) GetOrCreateItem ¶
func (*Property) GroupBySchema ¶
func (p *Property) GroupBySchema(id SchemaGroupID) *Group
func (*Property) GroupListBySchema ¶
func (p *Property) GroupListBySchema(id SchemaGroupID) *GroupList
func (*Property) HasLinkedField ¶
func (*Property) IsDatasetLinked ¶
func (p *Property) IsDatasetLinked(s DatasetSchemaID, i DatasetID) bool
func (*Property) ItemBySchema ¶
func (p *Property) ItemBySchema(id SchemaGroupID) Item
ItemBySchema returns a root item by a schema group ID.
func (*Property) MigrateDataset ¶
func (p *Property) MigrateDataset(q DatasetMigrationParam)
func (*Property) MigrateSchema ¶
TODO: group migration
func (*Property) MoveListItem ¶
func (*Property) RemoveField ¶
func (*Property) RemoveItem ¶
func (*Property) RemoveListItem ¶
func (*Property) UnlinkAllByDataset ¶
func (p *Property) UnlinkAllByDataset(s DatasetSchemaID, ds DatasetID)
func (*Property) UpdateLinkableValue ¶
func (*Property) UpdateValue ¶
func (*Property) ValidateSchema ¶
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
func (*Schema) DetectDuplicatedFields ¶
func (*Schema) Field ¶
func (p *Schema) Field(id FieldID) *SchemaField
func (*Schema) FieldByPointer ¶
func (p *Schema) FieldByPointer(ptr *Pointer) *SchemaField
func (*Schema) Fields ¶
func (p *Schema) Fields() []*SchemaField
func (*Schema) Group ¶
func (p *Schema) Group(id SchemaGroupID) *SchemaGroup
func (*Schema) GroupByField ¶
func (p *Schema) GroupByField(id FieldID) *SchemaGroup
func (*Schema) GroupByPointer ¶
func (p *Schema) GroupByPointer(ptr *Pointer) *SchemaGroup
func (*Schema) Groups ¶
func (p *Schema) Groups() []*SchemaGroup
func (*Schema) LinkableFields ¶
func (p *Schema) LinkableFields() LinkableFields
type SchemaBuilder ¶
type SchemaBuilder struct {
// contains filtered or unexported fields
}
func NewSchema ¶
func NewSchema() *SchemaBuilder
func (*SchemaBuilder) Build ¶
func (b *SchemaBuilder) Build() (*Schema, error)
func (*SchemaBuilder) Groups ¶
func (b *SchemaBuilder) Groups(groups []*SchemaGroup) *SchemaBuilder
func (*SchemaBuilder) ID ¶
func (b *SchemaBuilder) ID(id SchemaID) *SchemaBuilder
func (*SchemaBuilder) LinkableFields ¶
func (b *SchemaBuilder) LinkableFields(l LinkableFields) *SchemaBuilder
func (*SchemaBuilder) MustBuild ¶
func (b *SchemaBuilder) MustBuild() *Schema
func (*SchemaBuilder) Version ¶
func (b *SchemaBuilder) Version(version int) *SchemaBuilder
type SchemaField ¶
type SchemaField struct {
// contains filtered or unexported fields
}
func (*SchemaField) Choice ¶
func (p *SchemaField) Choice(key string) *SchemaFieldChoice
func (*SchemaField) Choices ¶
func (p *SchemaField) Choices() []SchemaFieldChoice
func (*SchemaField) DefaultValue ¶
func (p *SchemaField) DefaultValue() *Value
func (*SchemaField) Description ¶
func (p *SchemaField) Description() i18n.String
func (*SchemaField) ID ¶
func (p *SchemaField) ID() FieldID
func (*SchemaField) IsAvailableIf ¶
func (p *SchemaField) IsAvailableIf() *Condition
func (*SchemaField) Max ¶
func (p *SchemaField) Max() *float64
func (*SchemaField) Min ¶
func (p *SchemaField) Min() *float64
func (*SchemaField) MinMax ¶
func (p *SchemaField) MinMax() (*float64, *float64)
func (*SchemaField) Prefix ¶
func (p *SchemaField) Prefix() string
func (*SchemaField) SetDescription ¶
func (p *SchemaField) SetDescription(des i18n.String)
func (*SchemaField) SetTitle ¶
func (p *SchemaField) SetTitle(title i18n.String)
func (*SchemaField) Suffix ¶
func (p *SchemaField) Suffix() string
func (*SchemaField) Title ¶
func (p *SchemaField) Title() i18n.String
func (*SchemaField) Type ¶
func (p *SchemaField) Type() ValueType
func (*SchemaField) UI ¶
func (p *SchemaField) UI() *SchemaFieldUI
func (*SchemaField) Validate ¶
func (p *SchemaField) Validate(value *OptionalValue) bool
type SchemaFieldBuilder ¶
type SchemaFieldBuilder struct {
// contains filtered or unexported fields
}
func NewSchemaField ¶
func NewSchemaField() *SchemaFieldBuilder
func (*SchemaFieldBuilder) Build ¶
func (b *SchemaFieldBuilder) Build() (*SchemaField, error)
func (*SchemaFieldBuilder) Choices ¶
func (b *SchemaFieldBuilder) Choices(choices []SchemaFieldChoice) *SchemaFieldBuilder
func (*SchemaFieldBuilder) DefaultValue ¶
func (b *SchemaFieldBuilder) DefaultValue(v *Value) *SchemaFieldBuilder
func (*SchemaFieldBuilder) Description ¶
func (b *SchemaFieldBuilder) Description(description i18n.String) *SchemaFieldBuilder
func (*SchemaFieldBuilder) ID ¶
func (b *SchemaFieldBuilder) ID(id FieldID) *SchemaFieldBuilder
func (*SchemaFieldBuilder) IsAvailableIf ¶
func (b *SchemaFieldBuilder) IsAvailableIf(cond *Condition) *SchemaFieldBuilder
func (*SchemaFieldBuilder) Max ¶
func (b *SchemaFieldBuilder) Max(max float64) *SchemaFieldBuilder
func (*SchemaFieldBuilder) MaxRef ¶
func (b *SchemaFieldBuilder) MaxRef(max *float64) *SchemaFieldBuilder
func (*SchemaFieldBuilder) Min ¶
func (b *SchemaFieldBuilder) Min(min float64) *SchemaFieldBuilder
func (*SchemaFieldBuilder) MinRef ¶
func (b *SchemaFieldBuilder) MinRef(min *float64) *SchemaFieldBuilder
func (*SchemaFieldBuilder) MustBuild ¶
func (b *SchemaFieldBuilder) MustBuild() *SchemaField
func (*SchemaFieldBuilder) Name ¶
func (b *SchemaFieldBuilder) Name(name i18n.String) *SchemaFieldBuilder
func (*SchemaFieldBuilder) Prefix ¶
func (b *SchemaFieldBuilder) Prefix(prefix string) *SchemaFieldBuilder
func (*SchemaFieldBuilder) Suffix ¶
func (b *SchemaFieldBuilder) Suffix(suffix string) *SchemaFieldBuilder
func (*SchemaFieldBuilder) Type ¶
func (b *SchemaFieldBuilder) Type(propertyType ValueType) *SchemaFieldBuilder
func (*SchemaFieldBuilder) UI ¶
func (b *SchemaFieldBuilder) UI(ui SchemaFieldUI) *SchemaFieldBuilder
func (*SchemaFieldBuilder) UIRef ¶
func (b *SchemaFieldBuilder) UIRef(ui *SchemaFieldUI) *SchemaFieldBuilder
type SchemaFieldChoice ¶
func (SchemaFieldChoice) Copy ¶
func (c SchemaFieldChoice) Copy() SchemaFieldChoice
func (*SchemaFieldChoice) SetTitle ¶
func (c *SchemaFieldChoice) SetTitle(l i18n.String)
type SchemaFieldUI ¶
type SchemaFieldUI string
const ( SchemaFieldUIMultiline SchemaFieldUI = "multiline" SchemaFieldUISelection SchemaFieldUI = "selection" SchemaFieldUIColor SchemaFieldUI = "color" SchemaFieldUIRange SchemaFieldUI = "range" SchemaFieldUIImage SchemaFieldUI = "image" SchemaFieldUIVideo SchemaFieldUI = "video" SchemaFieldUIFile SchemaFieldUI = "file" SchemaFieldUILayer SchemaFieldUI = "layer" SchemaFieldUICameraPose SchemaFieldUI = "camera_pose" )
func SchemaFieldUIFrom ¶
func SchemaFieldUIFrom(ui string) SchemaFieldUI
func SchemaFieldUIFromRef ¶
func SchemaFieldUIFromRef(ui *string) *SchemaFieldUI
func (SchemaFieldUI) String ¶
func (p SchemaFieldUI) String() string
func (*SchemaFieldUI) StringRef ¶
func (p *SchemaFieldUI) StringRef() *string
type SchemaGroup ¶
type SchemaGroup struct {
// contains filtered or unexported fields
}
SchemaGroup represents a group of property that has some fields
func (*SchemaGroup) Field ¶
func (s *SchemaGroup) Field(fid FieldID) *SchemaField
Field returns a field whose id is specified
func (*SchemaGroup) FieldByPointer ¶
func (s *SchemaGroup) FieldByPointer(ptr *Pointer) *SchemaField
FieldByPointer returns a field whose id is specified
func (*SchemaGroup) Fields ¶
func (s *SchemaGroup) Fields() []*SchemaField
Fields returns a slice of fields
func (*SchemaGroup) HasField ¶
func (s *SchemaGroup) HasField(i FieldID) bool
func (*SchemaGroup) IDRef ¶
func (s *SchemaGroup) IDRef() *SchemaGroupID
func (*SchemaGroup) IsAvailableIf ¶
func (s *SchemaGroup) IsAvailableIf() *Condition
IsAvailableIf returns condition of availability
func (*SchemaGroup) IsList ¶
func (s *SchemaGroup) IsList() bool
IsList returns true if this group is list
func (*SchemaGroup) RepresentativeField ¶
func (s *SchemaGroup) RepresentativeField() *SchemaField
RepresentativeField returns the representative field of the group
func (*SchemaGroup) RepresentativeFieldID ¶
func (s *SchemaGroup) RepresentativeFieldID() *FieldID
RepresentativeFieldID returns the representative field ID of the group
func (*SchemaGroup) SetTitle ¶
func (s *SchemaGroup) SetTitle(t i18n.String)
func (*SchemaGroup) Title ¶
func (s *SchemaGroup) Title() i18n.String
Title returns a title of the group
type SchemaGroupBuilder ¶
type SchemaGroupBuilder struct {
// contains filtered or unexported fields
}
func NewSchemaGroup ¶
func NewSchemaGroup() *SchemaGroupBuilder
func (*SchemaGroupBuilder) Build ¶
func (b *SchemaGroupBuilder) Build() (*SchemaGroup, error)
func (*SchemaGroupBuilder) Fields ¶
func (b *SchemaGroupBuilder) Fields(fields []*SchemaField) *SchemaGroupBuilder
func (*SchemaGroupBuilder) ID ¶
func (b *SchemaGroupBuilder) ID(id SchemaGroupID) *SchemaGroupBuilder
func (*SchemaGroupBuilder) IsAvailableIf ¶
func (b *SchemaGroupBuilder) IsAvailableIf(cond *Condition) *SchemaGroupBuilder
func (*SchemaGroupBuilder) IsList ¶
func (b *SchemaGroupBuilder) IsList(list bool) *SchemaGroupBuilder
func (*SchemaGroupBuilder) MustBuild ¶
func (b *SchemaGroupBuilder) MustBuild() *SchemaGroup
func (*SchemaGroupBuilder) RepresentativeField ¶
func (b *SchemaGroupBuilder) RepresentativeField(representativeField *FieldID) *SchemaGroupBuilder
func (*SchemaGroupBuilder) Title ¶
func (b *SchemaGroupBuilder) Title(title i18n.String) *SchemaGroupBuilder
type SchemaGroupID ¶ added in v0.4.0
type SchemaGroupID = id.PropertySchemaGroupID
type SchemaID ¶ added in v0.4.0
type SchemaID = id.PropertySchemaID
type SchemaList ¶
type SchemaList []*Schema
func (SchemaList) Find ¶ added in v0.4.0
func (l SchemaList) Find(psid SchemaID) *Schema
func (SchemaList) Loader ¶ added in v0.4.0
func (l SchemaList) Loader() SchemaLoader
func (SchemaList) Map ¶
func (l SchemaList) Map() SchemaMap
type SchemaLoader ¶
type SchemaLoader func(context.Context, ...SchemaID) (SchemaList, error)
func SchemaLoaderFromMap ¶ added in v0.4.0
func SchemaLoaderFromMap(data map[SchemaID]*Schema) SchemaLoader
type SchemaMap ¶
func SchemaMapFrom ¶
func (SchemaMap) List ¶
func (m SchemaMap) List() SchemaList
func (SchemaMap) Loader ¶ added in v0.4.0
func (m SchemaMap) Loader() SchemaLoader
type Sealed ¶
type Sealed struct { Original *ID Parent *ID Schema SchemaID LinkedDataset *DatasetID Items []*SealedItem }
func (*Sealed) Field ¶
func (s *Sealed) Field(id FieldID) *SealedField
func (*Sealed) FieldBy ¶
func (s *Sealed) FieldBy(ptr *Pointer) *SealedField
func (*Sealed) Item ¶
func (s *Sealed) Item(i ItemID) *SealedItem
func (*Sealed) ItemBy ¶
func (s *Sealed) ItemBy(ptr *Pointer) *SealedItem
func (*Sealed) ItemBySchemaGroup ¶
func (s *Sealed) ItemBySchemaGroup(i SchemaGroupID) *SealedItem
type SealedField ¶
type SealedField struct { ID FieldID Val *ValueAndDatasetValue }
func (*SealedField) Value ¶ added in v0.3.0
func (f *SealedField) Value() *Value
type SealedItem ¶
type SealedItem struct { Original *ItemID Parent *ItemID SchemaGroup SchemaGroupID LinkedDataset *DatasetID Fields []*SealedField Groups []*SealedItem }
func (*SealedItem) Field ¶
func (s *SealedItem) Field(id FieldID) *SealedField
func (*SealedItem) Group ¶
func (s *SealedItem) Group(id ItemID) *SealedItem
func (*SealedItem) Interface ¶
func (s *SealedItem) Interface() interface{}
func (*SealedItem) Match ¶
func (s *SealedItem) Match(id ItemID) bool
type Typography ¶
type Typography struct { FontFamily *string `json:"fontFamily" mapstructure:"fontFamily"` FontWeight *string `json:"fontWeight" mapstructure:"fontWeight"` FontSize *int `json:"fontSize" mapstructure:"fontSize"` Color *string `json:"color" mapstructure:"color"` TextAlign *TextAlign `json:"textAlign" mapstructure:"textAlign"` Bold *bool `json:"bold" mapstructure:"bold"` Italic *bool `json:"italic" mapstructure:"italic"` Underline *bool `json:"underline" mapstructure:"underline"` }
func (*Typography) Clone ¶
func (t *Typography) Clone() *Typography
type Validator ¶
type Validator struct {
SchemaLoader SchemaLoader
}
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
func ValueFromStringOrNumber ¶ added in v0.3.0
func (*Value) Some ¶ added in v0.4.0
func (v *Value) Some() *OptionalValue
func (*Value) ValueCamera ¶
func (*Value) ValueCoordinates ¶
func (v *Value) ValueCoordinates() *Coordinates
func (*Value) ValueLatLng ¶
func (*Value) ValueLatLngHeight ¶
func (v *Value) ValueLatLngHeight() *LatLngHeight
func (*Value) ValueNumber ¶
func (*Value) ValuePolygon ¶
func (*Value) ValueString ¶
func (*Value) ValueTypography ¶
func (v *Value) ValueTypography() (vv Typography, ok bool)
type ValueAndDatasetValue ¶ added in v0.3.0
type ValueAndDatasetValue struct {
// contains filtered or unexported fields
}
func NewValueAndDatasetValue ¶ added in v0.3.0
func NewValueAndDatasetValue(ty ValueType, d *dataset.Value, p *Value) *ValueAndDatasetValue
func (*ValueAndDatasetValue) DatasetValue ¶ added in v0.3.0
func (v *ValueAndDatasetValue) DatasetValue() *dataset.Value
func (*ValueAndDatasetValue) PropertyValue ¶ added in v0.3.0
func (v *ValueAndDatasetValue) PropertyValue() *Value
func (*ValueAndDatasetValue) Type ¶ added in v0.3.0
func (v *ValueAndDatasetValue) Type() ValueType
func (*ValueAndDatasetValue) Value ¶ added in v0.3.0
func (v *ValueAndDatasetValue) Value() *Value
type ValueType ¶
func (ValueType) MustBeValue ¶
func (ValueType) None ¶ added in v0.4.0
func (vt ValueType) None() *OptionalValue
Source Files ¶
- builder.go
- condition.go
- field.go
- field_builder.go
- group.go
- group_builder.go
- group_list.go
- group_list_builder.go
- id.go
- initializer.go
- item.go
- item_builder.go
- link.go
- list.go
- loader.go
- merged.go
- migrator.go
- pointer.go
- property.go
- schema.go
- schema_builder.go
- schema_field.go
- schema_field_builder.go
- schema_field_ui.go
- schema_group.go
- schema_group_builder.go
- schema_list.go
- sealed.go
- validator.go
- value.go
- value_camera.go
- value_dataset.go
- value_optional.go
- value_typography.go