// Package orm define database data struct package orm import ( "time" "github.com/gofrs/uuid" ) // Component structure define abstracted info set of electrical component type Component struct { GlobalUUID uuid.UUID `gorm:"column:GLOBAL_UUID;primaryKey"` NsPath string `gorm:"column:NSPATH"` Tag string `gorm:"column:TAG"` Name string `gorm:"column:NAME"` ModelName string `gorm:"column:MODEL_NAME"` Description string `gorm:"column:DESCRIPTION"` GridTag string `gorm:"column:GRID"` ZoneTag string `gorm:"column:ZONE"` StationTag string `gorm:"column:STATION"` Type int `gorm:"column:TYPE"` InService bool `gorm:"column:IN_SERVICE"` State int `gorm:"column:STATE"` Status int `gorm:"column:STATUS"` Connection map[string]interface{} `gorm:"column:CONNECTION;type:jsonb;default:'{}'"` Label map[string]interface{} `gorm:"column:LABEL;type:jsonb;default:'{}'"` Context string `gorm:"column:CONTEXT"` Op int `gorm:"column:OP"` Ts time.Time `gorm:"column:TS"` } // TableName func respresent return table name of Component func (c *Component) TableName() string { return "COMPONENT" }