item

package
v0.0.0-...-7d6b287 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidID = id.ErrInvalidID
View Source
var FieldIDFrom = id.FieldIDFrom
View Source
var FieldIDFromRef = id.FieldIDFromRef
View Source
var IDFrom = id.ItemIDFrom
View Source
var IDFromRef = id.ItemIDFromRef
View Source
var MustFieldID = id.MustFieldID
View Source
var MustID = id.MustItemID
View Source
var MustThreadID = id.MustThreadID
View Source
var NewFieldID = id.NewFieldID
View Source
var NewID = id.NewItemID
View Source
var NewThreadID = id.NewThreadID
View Source
var ThreadIDFrom = id.ThreadIDFrom
View Source
var ThreadIDFromRef = id.ThreadIDFromRef

Functions

func AreItemsReferenced

func AreItemsReferenced(i1, i2 *Item, s1, s2 *schema.Schema) (*id.FieldID, *id.FieldID)

Types

type AssetID

type AssetID = id.AssetID

type AssetIDList

type AssetIDList = id.AssetIDList

type Builder

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

func New

func New() *Builder

func (*Builder) Build

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

func (*Builder) Fields

func (b *Builder) Fields(fields []*Field) *Builder

func (*Builder) ID

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

func (*Builder) Integration

func (b *Builder) Integration(id IntegrationID) *Builder

func (*Builder) IsMetadata

func (b *Builder) IsMetadata(im bool) *Builder

func (*Builder) MetadataItem

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

func (*Builder) Model

func (b *Builder) Model(mid ModelID) *Builder

func (*Builder) MustBuild

func (b *Builder) MustBuild() *Item

func (*Builder) NewID

func (b *Builder) NewID() *Builder

func (*Builder) NewThread

func (b *Builder) NewThread() *Builder

func (*Builder) OriginalItem

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

func (*Builder) Project

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

func (*Builder) Schema

func (b *Builder) Schema(sid schema.ID) *Builder

func (*Builder) Thread

func (b *Builder) Thread(tid ThreadID) *Builder

func (*Builder) Timestamp

func (b *Builder) Timestamp(createdAt time.Time) *Builder

func (*Builder) UpdatedByIntegration

func (b *Builder) UpdatedByIntegration(id *IntegrationID) *Builder

func (*Builder) UpdatedByUser

func (b *Builder) UpdatedByUser(id *UserID) *Builder

func (*Builder) User

func (b *Builder) User(id UserID) *Builder

type Field

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

func NewField

func NewField(field FieldID, v *value.Multiple, ig *ItemGroupID) *Field

func (*Field) FieldID

func (f *Field) FieldID() schema.FieldID

func (*Field) IsGeometryField

func (f *Field) IsGeometryField() bool

func (*Field) ItemGroup

func (f *Field) ItemGroup() *ItemGroupID

func (*Field) Type

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

func (*Field) Value

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

type FieldChange

type FieldChange struct {
	ID            FieldID
	Type          FieldChangeType
	CurrentValue  *value.Multiple
	PreviousValue *value.Multiple
}

type FieldChangeType

type FieldChangeType string
const (
	FieldChangeTypeAdd    FieldChangeType = "add"
	FieldChangeTypeUpdate FieldChangeType = "update"
	FieldChangeTypeDelete FieldChangeType = "delete"
)

type FieldChanges

type FieldChanges []FieldChange

func CompareFields

func CompareFields(n, o Fields) FieldChanges

type FieldID

type FieldID = id.FieldID

type FieldIDList

type FieldIDList = id.FieldIDList

type FieldMap

type FieldMap map[FieldID]*Field

type Fields

type Fields []*Field

func (Fields) Field

func (f Fields) Field(fID FieldID) *Field

func (Fields) FieldsByGroup

func (f Fields) FieldsByGroup(iid id.ItemGroupID) []*Field

func (Fields) FieldsByType

func (f Fields) FieldsByType(t value.Type) []*Field

func (Fields) Map

func (f Fields) Map() FieldMap

type ID

type ID = id.ItemID

type IDList

type IDList = id.ItemIDList

type IntegrationID

type IntegrationID = id.IntegrationID

type Item

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

func (*Item) AssetIDs

func (i *Item) AssetIDs() AssetIDList

func (*Item) ClearField

func (i *Item) ClearField(fid FieldID)

func (*Item) ClearReferenceFields

func (i *Item) ClearReferenceFields()

func (*Item) Field

func (i *Item) Field(f FieldID) *Field

func (*Item) FieldByItemGroupAndID

func (i *Item) FieldByItemGroupAndID(fid FieldID, igID ItemGroupID) *Field

func (*Item) Fields

func (i *Item) Fields() Fields

func (*Item) FilterFields

func (i *Item) FilterFields(list FieldIDList) *Item

func (*Item) GetFirstGeometryField

func (i *Item) GetFirstGeometryField() (*Field, bool)

func (*Item) GetTitle

func (i *Item) GetTitle(s *schema.Schema) *string

func (*Item) HasField

func (i *Item) HasField(fid FieldID, value any) bool

func (*Item) ID

func (i *Item) ID() ID

func (*Item) Integration

func (i *Item) Integration() *IntegrationID

func (*Item) IsMetadata

func (i *Item) IsMetadata() bool

func (*Item) MetadataItem

func (i *Item) MetadataItem() *ID

func (*Item) Model

func (i *Item) Model() ModelID

func (*Item) OriginalItem

func (i *Item) OriginalItem() *ID

func (*Item) Project

func (i *Item) Project() ProjectID

func (*Item) Schema

func (i *Item) Schema() SchemaID

func (*Item) SetMetadataItem

func (i *Item) SetMetadataItem(iid id.ItemID)

func (*Item) SetOriginalItem

func (i *Item) SetOriginalItem(iid id.ItemID)

func (*Item) SetUpdatedByIntegration

func (i *Item) SetUpdatedByIntegration(u IntegrationID)

func (*Item) SetUpdatedByUser

func (i *Item) SetUpdatedByUser(u UserID)

func (*Item) Thread

func (i *Item) Thread() ThreadID

func (*Item) Timestamp

func (i *Item) Timestamp() time.Time

func (*Item) UpdateFields

func (i *Item) UpdateFields(fields []*Field)

func (*Item) UpdatedByIntegration

func (i *Item) UpdatedByIntegration() *IntegrationID

func (*Item) UpdatedByUser

func (i *Item) UpdatedByUser() *UserID

func (*Item) User

func (i *Item) User() *UserID

type ItemGroupID

type ItemGroupID = id.ItemGroupID

type ItemModelSchema

type ItemModelSchema struct {
	Item            *Item
	ReferencedItems []Versioned
	Model           *model.Model
	Schema          *schema.Schema
	GroupSchemas    schema.List
	Changes         FieldChanges
}

type List

type List []*Item

func (List) FilterFields

func (l List) FilterFields(lids FieldIDList) List

func (List) IDs

func (l List) IDs() IDList

func (List) Item

func (l List) Item(iID ID) (*Item, bool)

func (List) ItemsByField

func (l List) ItemsByField(fid FieldID, value any) List

type ModelID

type ModelID = id.ModelID

type ProjectID

type ProjectID = id.ProjectID

type Query

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

func NewQuery

func NewQuery(project id.ProjectID, model id.ModelID, schema *id.SchemaID, keyword string, ref *version.Ref) *Query

func (*Query) Fields

func (q *Query) Fields() view.FieldSelectorList

func (*Query) Filter

func (q *Query) Filter() *view.Condition

func (*Query) HasItemFields

func (q *Query) HasItemFields() bool

func (*Query) HasMetaFields

func (q *Query) HasMetaFields() bool

func (*Query) ItemFields

func (q *Query) ItemFields() view.FieldSelectorList

func (*Query) Keyword

func (q *Query) Keyword() string

func (*Query) MetaFields

func (q *Query) MetaFields() view.FieldSelectorList

func (*Query) Model

func (q *Query) Model() id.ModelID

func (*Query) Project

func (q *Query) Project() id.ProjectID

func (*Query) Ref

func (q *Query) Ref() *version.Ref

func (*Query) Schema

func (q *Query) Schema() *id.SchemaID

func (*Query) Sort

func (q *Query) Sort() *view.Sort

func (*Query) WithFilter

func (q *Query) WithFilter(filter *view.Condition) *Query

func (*Query) WithSort

func (q *Query) WithSort(sort *view.Sort) *Query

type SchemaID

type SchemaID = id.SchemaID

type Status

type Status int
var (
	StatusDraft        Status = 0
	StatusChanged      Status = 1
	StatusReview       Status = 2
	StatusPublic       Status = 3
	StatusPublicDraft  Status = 4
	StatusPublicReview Status = 5
)

func (Status) Wrap

func (s Status) Wrap(s2 Status) Status

type ThreadID

type ThreadID = id.ThreadID

type UserID

type UserID = accountdomain.UserID

type Versioned

type Versioned = *version.Value[*Item]

type VersionedList

type VersionedList []Versioned

func (VersionedList) FilterFields

func (l VersionedList) FilterFields(fields FieldIDList) VersionedList

func (VersionedList) Item

func (l VersionedList) Item(iid ID) Versioned

func (VersionedList) ToMap

func (l VersionedList) ToMap() map[ID]*version.Value[*Item]

func (VersionedList) Unwrap

func (l VersionedList) Unwrap() List

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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