Documentation ¶
Index ¶
- type EnumType
- type FieldDefinition
- func (field FieldDefinition) ConvertFromModel(name string, value interface{}) (interface{}, error)
- func (field FieldDefinition) ConvertToModel(name string, value interface{}) (interface{}, error)
- func (self FieldDefinition) MarshalJSON() ([]byte, error)
- func (j *FieldDefinition) Scan(src interface{}) error
- func (self *FieldDefinition) UnmarshalJSON(bytes []byte) error
- func (j FieldDefinition) Value() (driver.Value, error)
- type FieldType
- type Fields
- type Kind
- type ListType
- type SimpleType
- type WorkItem
- type WorkItemType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnumType ¶
type EnumType struct { SimpleType BaseType SimpleType Values []interface{} }
func (EnumType) ConvertFromModel ¶
func (EnumType) ConvertToModel ¶
type FieldDefinition ¶
FieldDefintion describes type & other restrictions of a field
func (FieldDefinition) ConvertFromModel ¶
func (field FieldDefinition) ConvertFromModel(name string, value interface{}) (interface{}, error)
Convert from json storage to API form.
func (FieldDefinition) ConvertToModel ¶
func (field FieldDefinition) ConvertToModel(name string, value interface{}) (interface{}, error)
Convert a field value for storage as json. As the system matures, add more checks (for example whether a user is in the system, etc.)
func (FieldDefinition) MarshalJSON ¶
func (self FieldDefinition) MarshalJSON() ([]byte, error)
MarshalJSON implements encoding/json.Marshaler
func (*FieldDefinition) Scan ¶
func (j *FieldDefinition) Scan(src interface{}) error
func (*FieldDefinition) UnmarshalJSON ¶
func (self *FieldDefinition) UnmarshalJSON(bytes []byte) error
UnmarshalJSON implements encoding/json.Unmarshaler
type FieldType ¶
type FieldType interface { GetKind() Kind /* ConvertToModel converts a field value for use in the REST API */ ConvertToModel(value interface{}) (interface{}, error) /* ConvertToModel converts a field value for storage in the db */ ConvertFromModel(value interface{}) (interface{}, error) }
FieldType describes the possible values of a FieldDefinition
type ListType ¶
type ListType struct { SimpleType ComponentType SimpleType }
ListType describes a list of SimpleType values
func (ListType) ConvertFromModel ¶
ConvertFromModel implements the FieldType interface
func (ListType) ConvertToModel ¶
ConvertToModel implements the FieldType interface
type SimpleType ¶
type SimpleType struct {
Kind Kind
}
SimpleType is an unstructured FieldType
func (SimpleType) ConvertFromModel ¶
func (fieldType SimpleType) ConvertFromModel(value interface{}) (interface{}, error)
ConvertFromModel implements the FieldType interface
func (SimpleType) ConvertToModel ¶
func (fieldType SimpleType) ConvertToModel(value interface{}) (interface{}, error)
ConvertToModel implements the FieldType interface
type WorkItemType ¶
type WorkItemType struct { // internal id of this work item type Id uint64 // the name of this work item type. Does not have to be unique. Name string // definitions of the fields this work item type supports Fields map[string]FieldDefinition `sql:"type:jsonb"` }