Documentation ¶
Index ¶
- Variables
- type Asset
- type Bool
- type DateTime
- type Group
- type Integer
- type Match
- type Multiple
- func (m *Multiple) Cast(t Type) *Multiple
- func (m *Multiple) Clone() *Multiple
- func (m *Multiple) Equal(w *Multiple) bool
- func (m *Multiple) First() *Value
- func (m *Multiple) Interface() []any
- func (m *Multiple) IsEmpty() bool
- func (m *Multiple) Len() int
- func (m *Multiple) Type() Type
- func (m *Multiple) Validate() bool
- func (m *Multiple) Values() []*Value
- func (m *Multiple) ValuesAsset() (vv []Asset, ok bool)
- func (m *Multiple) ValuesBool() (vv []bool, ok bool)
- func (m *Multiple) ValuesDateTime() (vv []DateTime, ok bool)
- func (m *Multiple) ValuesGroup() (vv []Group, ok bool)
- func (m *Multiple) ValuesInteger() (vv []Integer, ok bool)
- func (m *Multiple) ValuesNumber() (vv []Number, ok bool)
- func (m *Multiple) ValuesReference() (vv []Reference, ok bool)
- func (m *Multiple) ValuesString() (vv []String, ok bool)
- func (m *Multiple) ValuesURL() (vv []URL, ok bool)
- type Number
- type Optional
- func (ov *Optional) Cast(t Type) *Optional
- func (ov *Optional) Clone() *Optional
- func (ov *Optional) IsEmpty() bool
- func (ov *Optional) IsNone() bool
- func (ov *Optional) IsSome() bool
- func (ov *Optional) Match(m OptionalMatch)
- func (ov *Optional) SetValue(v *Value)
- func (ov *Optional) Type() Type
- func (ov *Optional) TypeAndValue() (Type, *Value)
- func (ov *Optional) Value() *Value
- type OptionalMatch
- type Reference
- type String
- type Type
- type TypeProperty
- type TypeRegistry
- type URL
- type Value
- func (v *Value) AsMultiple() *Multiple
- func (v *Value) Cast(t Type) *Value
- func (v *Value) Clone() *Value
- func (v *Value) Equal(w *Value) bool
- func (v *Value) Interface() any
- func (v *Value) IsEmpty() bool
- func (v *Value) Match(m Match)
- func (v *Value) Some() *Optional
- func (v *Value) Type() Type
- func (v *Value) TypeProperty() (tp TypeProperty)
- func (v *Value) Validate() bool
- func (v *Value) Value() interface{}
- func (v *Value) ValueAsset() (vv Asset, ok bool)
- func (v *Value) ValueBool() (vv bool, ok bool)
- func (v *Value) ValueDateTime() (vv DateTime, ok bool)
- func (v *Value) ValueGroup() (vv Group, ok bool)
- func (v *Value) ValueInteger() (vv Integer, ok bool)
- func (v *Value) ValueNumber() (vv Number, ok bool)
- func (v *Value) ValueReference() (vv Reference, ok bool)
- func (v *Value) ValueString() (vv String, ok bool)
- func (v *Value) ValueURL() (vv URL, ok bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var TypeUnknown = Type("")
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group = id.ItemGroupID
type Match ¶
type Match struct { Asset func(Asset) Bool func(Bool) Checkbox func(Bool) DateTime func(DateTime) Integer func(Integer) Number func(Number) String func(String) Text func(String) TextArea func(String) RichText func(String) Markdown func(String) Select func(String) Tag func(String) Reference func(Reference) URL func(URL) Group func(Group) GeometryObject func(String) GeometryEditor func(String) Default func() }
type Multiple ¶
type Multiple struct {
// contains filtered or unexported fields
}
func MultipleFrom ¶
func NewMultiple ¶
func (*Multiple) ValuesAsset ¶
func (*Multiple) ValuesBool ¶
func (*Multiple) ValuesDateTime ¶
func (*Multiple) ValuesGroup ¶
func (*Multiple) ValuesInteger ¶
func (*Multiple) ValuesNumber ¶
func (*Multiple) ValuesReference ¶
func (*Multiple) ValuesString ¶
type Optional ¶
type Optional struct {
// contains filtered or unexported fields
}
func NewOptional ¶
func OptionalFrom ¶
func (*Optional) Cast ¶
Cast tries to convert the value to the new type and generates a new Optional.
func (*Optional) Match ¶
func (ov *Optional) Match(m OptionalMatch)
func (*Optional) TypeAndValue ¶
type OptionalMatch ¶
type OptionalMatch struct { Match None func() }
type Type ¶
type Type string
const TypeAsset Type = "asset"
const TypeBool Type = "bool"
const TypeCheckbox Type = "checkbox"
const TypeDateTime Type = "datetime"
const TypeGeometryEditor Type = "geometryEditor"
const TypeGeometryObject Type = "geometryObject"
const TypeGroup Type = "group"
const TypeInteger Type = "integer"
const TypeMarkdown Type = "markdown"
const TypeNumber Type = "number"
const TypeReference Type = "reference"
const TypeRichText Type = "richText"
const TypeSelect Type = "select"
const TypeTag Type = "tag"
const TypeText Type = "text"
const TypeTextArea Type = "textArea"
const TypeURL Type = "url"
func (Type) IsGeometryFieldType ¶
type TypeProperty ¶
type TypeRegistry ¶
type TypeRegistry map[Type]TypeProperty
func (TypeRegistry) Find ¶
func (r TypeRegistry) Find(t Type) (tp TypeProperty)
func (TypeRegistry) Get ¶
func (r TypeRegistry) Get(t Type) TypeProperty
func (TypeRegistry) ToInterface ¶
func (r TypeRegistry) ToInterface(t Type, v any) (any, bool)
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
func NewWithTypeRegistry ¶
func NewWithTypeRegistry(t Type, v any, p TypeRegistry) *Value
func (*Value) AsMultiple ¶
func (*Value) TypeProperty ¶
func (v *Value) TypeProperty() (tp TypeProperty)
func (*Value) ValueAsset ¶
func (*Value) ValueDateTime ¶
func (*Value) ValueGroup ¶
func (*Value) ValueInteger ¶
func (*Value) ValueNumber ¶
func (*Value) ValueReference ¶
func (*Value) ValueString ¶
Click to show internal directories.
Click to hide internal directories.