Documentation ¶
Index ¶
- Constants
- Variables
- func Contains(fieldType string) bool
- type Field
- type Fields
- type FieldsByName
- type ID
- type Model
- func (m Model) ByID(contID container.ID, fieldID ID) (*Field, string, int, error)
- func (m Model) Create(field *Field) (string, string, int, error)
- func (m Model) Delete(contID container.ID, fieldID ID) (ID, string, int, error)
- func (m Model) Get(contID container.ID) (Fields, string, int, error)
- func (m Model) UpdateName(contID container.ID, fieldID ID, name string) (string, int, error)
Constants ¶
View Source
const ( StringTypeID = 1 IntegerTypeID = 2 EmailTypeID = 3 BooleanTypeID = 4 )
View Source
const ( StringType = "STRING" IntegerType = "INTEGER" EmailType = "EMAIL" BooleanType = "BOOLEAN" DateTimeType = "DATETIME" )
data types and default values
View Source
const STYPE string = "Fields"
STYPE type of Fields module
View Source
const Type string = "Field"
Type of Model
Variables ¶
View Source
var ErrFieldNotFound = errors.New("field not found")
ErrFieldNotFound is to be returned where field is not found
Functions ¶
Types ¶
type Field ¶
type Field struct { ContainerID container.ID `json:"-" db:"CONTAINER_ID,omitempty"` ID ID `json:"_id,omitempty" db:"ID,omitempty"` Name string `json:"name,omitempty" db:"NAME,omitempty"` Type string `json:"type,omitempty" db:"TYPE,omitempty"` Encrypted uint8 `json:"encrypted,omitempty" db:"ENCRYPTED,omitempty"` Stream uint8 `json:"stream,omitempty" db:"STREAM,omitempty"` Created time.Time `json:"created,omitempty" db:"CREATED,omitempty"` Updated time.Time `json:"last_updated,omitempty" db:"UPDATED,omitempty"` }
Field field type
func GetFromPersistenceByID ¶
GetFromPersistenceByID get the field using its ID
type Fields ¶
type Fields []*Field
Fields list of Field
func GetFromPersistence ¶
GetFromPersistence fields of the object
type FieldsByName ¶
FieldsByName : Map of fields by its name
func FieldsToMapByName ¶
func FieldsToMapByName(fields Fields) FieldsByName
FieldsToMapByName convert list of fields to map of fields by its name
Click to show internal directories.
Click to hide internal directories.