Documentation ¶
Index ¶
- Constants
- func AddConnection(m *Connection) (id int64, err error)
- func AddDashboard(m *Dashboard) (id int64, err error)
- func AddDevice(m *Device) (id int64, err error)
- func AddDeviceAction(m *DeviceAction) (id int64, err error)
- func AddDeviceState(m *DeviceState) (id int64, err error)
- func AddFlow(m *Flow) (id int64, err error)
- func AddFlowElement(m *FlowElement) (id int64, err error)
- func AddImage(m *Image) (id int64, err error)
- func AddLog(m *Log) (id int64, err error)
- func AddMap(m *Map) (id int64, err error)
- func AddMapDevice(m *MapDevice) (id int64, err error)
- func AddMapDeviceAction(m *MapDeviceAction) (id int64, err error)
- func AddMapDeviceState(m *MapDeviceState) (id int64, err error)
- func AddMapElement(m *MapElement) (id int64, err error)
- func AddMapImage(m *MapImage) (id int64, err error)
- func AddMapLayer(m *MapLayer) (id int64, err error)
- func AddMapText(m *MapText) (id int64, err error)
- func AddMultipleFiles(images []*Image) (ids []int64, errs []error)
- func AddMultipleMapDeviceAction(actions []*MapDeviceAction) (ids []int64, errs []error)
- func AddMultipleMapDeviceState(states []*MapDeviceState) (ids []int64, errs []error)
- func AddNode(m *Node) (id int64, err error)
- func AddOrUpdateConnection(m *Connection) (id int64, err error)
- func AddOrUpdateFlowElement(m *FlowElement) (id int64, err error)
- func AddPermission(m *Permission) (id int64, err error)
- func AddRole(m *Role) (id int64, err error)
- func AddScript(m *Script) (id int64, err error)
- func AddUser(m *User) (id int64, err error)
- func AddUserMeta(m *UserMeta) (id int64, err error)
- func AddWorker(m *Worker) (id int64, err error)
- func AddWorkflow(m *Workflow) (id int64, err error)
- func DeleteConnection(uuid string) (err error)
- func DeleteDashboard(id int64) (err error)
- func DeleteDevice(id int64) (err error)
- func DeleteDeviceAction(id int64) (err error)
- func DeleteDeviceState(id int64) (err error)
- func DeleteFlow(id int64) (err error)
- func DeleteFlowElement(uuid string) (err error)
- func DeleteImage(id int64) (err error)
- func DeleteLog(id int64) (err error)
- func DeleteMap(id int64) (err error)
- func DeleteMapDevice(id int64) (err error)
- func DeleteMapDeviceAction(id int64) (err error)
- func DeleteMapDeviceState(id int64) (err error)
- func DeleteMapElement(id int64) (err error)
- func DeleteMapImage(id int64) (err error)
- func DeleteMapLayer(id int64) (err error)
- func DeleteMapText(id int64) (err error)
- func DeleteNode(id int64) (err error)
- func DeletePermission(id int64) (err error)
- func DeleteRole(name string) (err error)
- func DeleteScript(id int64) (err error)
- func DeleteUser(id int64) (err error)
- func DeleteUserMeta(id int64) (err error)
- func DeleteWorker(id int64) (err error)
- func DeleteWorkflow(id int64) (err error)
- func EmailItemAddNew(body []byte) (id int64, b bool, valid validation.Validation, err error)
- func EmailItemDelete(item_name string) (err error)
- func EmailItemGetSortedList() (count int, new_items []string, err error)
- func EmailItemParentUpdate(name, parent string) (err error)
- func EmailItemUpdate(body []byte, item_name string) (id int64, b bool, valid validation.Validation, err error)
- func EmailItemUpdateTree(body []byte) (err error)
- func EmailTemplateAddNew(body []byte) (id int64, b bool, valid validation.Validation, err error)
- func EmailTemplateDelete(name string) (err error)
- func EmailTemplatePreview(template *EmailTemplate) (buf string, err error)
- func EmailTemplateUpdate(body []byte, name string) (b bool, valid validation.Validation, err error)
- func FlowGetRelatedDate(flow *Flow) (err error)
- func GetAllConnection(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllDashboard(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllDevice(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllDeviceAction(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllDeviceState(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllEmailItem(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllFlow(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllFlowElement(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllImage(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllMap(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllMapDevice(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllMapDeviceAction(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllMapDeviceState(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllMapElement(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllMapImage(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllMapLayer(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllMapText(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllNode(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllPermission(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllRole(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllScript(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllUser(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllUserMeta(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllWorker(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetAllWorkflow(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, meta *map[string]int64, err error)
- func GetDevicesCount() (total int64, err error)
- func GetImageFilterList() (ml []orm.Params, err error)
- func GetNodesCount() (total int64, err error)
- func GetUserMeta(u *User, key string) string
- func InsertOrUpdateWorker(worker *Worker) (id int64, err error)
- func SetUserMeta(u *User, key, value string) (err error)
- func SortMapElements(m []*MapElement) (err error)
- func SortMapLayers(m []*MapLayer) (err error)
- func UpdateConnectionById(m *Connection) (err error)
- func UpdateDashboardById(m *Dashboard) (err error)
- func UpdateDeviceActionById(m *DeviceAction) (err error)
- func UpdateDeviceById(m *Device) (err error)
- func UpdateDeviceStateById(m *DeviceState) (err error)
- func UpdateFlowById(m *Flow) (err error)
- func UpdateFlowElementById(m *FlowElement) (err error)
- func UpdateImageById(m *Image) (err error)
- func UpdateLogById(m *Log) (err error)
- func UpdateMapById(m *Map) (err error)
- func UpdateMapDeviceActionById(m *MapDeviceAction) (err error)
- func UpdateMapDeviceById(m *MapDevice) (err error)
- func UpdateMapDeviceStateById(m *MapDeviceState) (err error)
- func UpdateMapElementById(m *MapElement) (err error)
- func UpdateMapImageById(m *MapImage) (err error)
- func UpdateMapLayerById(m *MapLayer) (err error)
- func UpdateMapTextById(m *MapText) (err error)
- func UpdateNodeById(m *Node) (err error)
- func UpdatePermissionById(m *Permission) (err error)
- func UpdateRoleByName(m *Role) (err error)
- func UpdateScriptById(m *Script) (err error)
- func UpdateUserById(m *User) (err error)
- func UpdateUserMetaById(m *UserMeta) (err error)
- func UpdateWorkerById(m *Worker) (err error)
- func UpdateWorkflowById(m *Workflow) (err error)
- type AccessItem
- type AccessLevels
- type AccessList
- type Connection
- type Dashboard
- type Device
- type DeviceAction
- type DeviceState
- type EmailItem
- type EmailRender
- type EmailTemplate
- type Field
- type Flow
- type FlowElement
- type Image
- type Items
- type Log
- type Map
- type MapDevice
- type MapDeviceAction
- type MapDeviceState
- type MapElement
- type MapImage
- type MapLayer
- type MapText
- type Node
- func (n *Node) GetConn() net.Conn
- func (n *Node) GetConnectStatus() string
- func (n *Node) GetVersion() (version string, err error)
- func (n *Node) ModbusSend(args interface{}, reply interface{}) error
- func (n *Node) RpcDial() (*rpc.Client, error)
- func (n *Node) Send(protocol string, args *r.Request) (result r.Result)
- func (n *Node) SetConnectStatus(st string)
- func (m *Node) TableName() string
- func (n *Node) TcpClose()
- func (n *Node) TcpDial() (net.Conn, error)
- func (n *Node) Valid(v *validation.Validation)
- type Permission
- type RedactorConnector
- type RedactorFlow
- type RedactorGrapSettings
- type RedactorObject
- type Role
- type Script
- type SortMapElementByWeight
- type SortMapLayersByWeight
- type Tree
- type User
- func (u *User) ClearResetPassToken() error
- func (u *User) GenResetPassToken() (token string, err error)
- func (u *User) GetHistory() (history []*UserHistory, err error)
- func (u *User) GetMeta(key string) string
- func (u *User) LoadRelated() (err error)
- func (u *User) NewToken() (token string, err error)
- func (u *User) SetMeta(key, value string) (err error)
- func (u *User) SetToken(token string) error
- func (u *User) SignIn(ipv4 string)
- func (m *User) TableName() string
- func (u *User) UpdateHistory(t time.Time, ipv4 string)
- func (u *User) UpdatePassword(password string) (err error)
- type UserHistory
- type UserMeta
- type Worker
- func GetAllEnabledWorkersByFlow(flow *Flow) (workers []*Worker, err error)
- func GetAllEnabledWorkersByWorkflow(workflow *Workflow) (workers []*Worker, err error)
- func GetWorkerById(id int64) (v *Worker, err error)
- func GetWorkersByDeviceAction(device_action *DeviceAction) (workers []*Worker, err error)
- func GetWorkersByFlow(flow *Flow) (workers []*Worker, err error)
- func GetWorkersByFlowId(id int64) (workers []*Worker, err error)
- type Workflow
Constants ¶
const HISTORY_MAX = 8
Variables ¶
This section is empty.
Functions ¶
func AddConnection ¶
func AddConnection(m *Connection) (id int64, err error)
AddConnection insert a new Connection into database and returns last inserted Id on success.
func AddDashboard ¶
AddDashboard insert a new Dashboard into database and returns last inserted Id on success.
func AddDevice ¶
AddDevice insert a new Device into database and returns last inserted Id on success.
func AddDeviceAction ¶
func AddDeviceAction(m *DeviceAction) (id int64, err error)
AddDeviceAction insert a new DeviceAction into database and returns last inserted Id on success.
func AddDeviceState ¶
func AddDeviceState(m *DeviceState) (id int64, err error)
AddDeviceState insert a new DeviceState into database and returns last inserted Id on success.
func AddFlowElement ¶
func AddFlowElement(m *FlowElement) (id int64, err error)
AddFlowElement insert a new FlowElement into database and returns last inserted Id on success.
func AddMapDevice ¶
AddMapDevice insert a new MapDevice into database and returns last inserted Id on success.
func AddMapDeviceAction ¶
func AddMapDeviceAction(m *MapDeviceAction) (id int64, err error)
AddMapDeviceAction insert a new MapDeviceAction into database and returns last inserted Id on success.
func AddMapDeviceState ¶
func AddMapDeviceState(m *MapDeviceState) (id int64, err error)
AddMapDeviceState insert a new MapDeviceState into database and returns last inserted Id on success.
func AddMapElement ¶
func AddMapElement(m *MapElement) (id int64, err error)
AddMapElement insert a new MapElement into database and returns last inserted Id on success.
func AddMapImage ¶
AddMapImage insert a new MapImage into database and returns last inserted Id on success.
func AddMapLayer ¶
AddMapLayer insert a new MapLayer into database and returns last inserted Id on success.
func AddMapText ¶
AddMapText insert a new MapText into database and returns last inserted Id on success.
func AddMultipleFiles ¶
AddMultipleFiles Use a prepared statement to increase inserting speed with multiple inserts.
func AddMultipleMapDeviceAction ¶
func AddMultipleMapDeviceAction(actions []*MapDeviceAction) (ids []int64, errs []error)
AddMultipleMapDeviceAction Use a prepared statement to increase inserting speed with multiple inserts.
func AddMultipleMapDeviceState ¶
func AddMultipleMapDeviceState(states []*MapDeviceState) (ids []int64, errs []error)
AddMultipleMapDeviceState Use a prepared statement to increase inserting speed with multiple inserts.
func AddOrUpdateConnection ¶
func AddOrUpdateConnection(m *Connection) (id int64, err error)
AddFlowElement insert a new FlowElement into database and returns last inserted Id on success.
func AddOrUpdateFlowElement ¶
func AddOrUpdateFlowElement(m *FlowElement) (id int64, err error)
AddFlowElement insert a new FlowElement into database and returns last inserted Id on success.
func AddPermission ¶
func AddPermission(m *Permission) (id int64, err error)
AddPermission insert a new Permission into database and returns last inserted Id on success.
func AddScript ¶
AddScript insert a new Script into database and returns last inserted Id on success.
func AddUserMeta ¶
AddUserMeta insert a new UserMeta into database and returns last inserted Id on success.
func AddWorker ¶
AddWorker insert a new Worker into database and returns last inserted Id on success.
func AddWorkflow ¶
AddWorkflow insert a new Workflow into database and returns last inserted Id on success.
func DeleteConnection ¶
DeleteConnection deletes Connection by Id and returns error if the record to be deleted doesn't exist
func DeleteDashboard ¶
DeleteDashboard deletes Dashboard by Id and returns error if the record to be deleted doesn't exist
func DeleteDevice ¶
DeleteDevice deletes Device by Id and returns error if the record to be deleted doesn't exist
func DeleteDeviceAction ¶
DeleteDeviceAction deletes DeviceAction by Id and returns error if the record to be deleted doesn't exist
func DeleteDeviceState ¶
DeleteDeviceState deletes DeviceState by Id and returns error if the record to be deleted doesn't exist
func DeleteFlow ¶
DeleteFlow deletes Flow by Id and returns error if the record to be deleted doesn't exist
func DeleteFlowElement ¶
DeleteFlowElement deletes FlowElement by Id and returns error if the record to be deleted doesn't exist
func DeleteImage ¶
DeleteImage deletes Image by Id and returns error if the record to be deleted doesn't exist
func DeleteLog ¶
DeleteLog deletes Log by Id and returns error if the record to be deleted doesn't exist
func DeleteMap ¶
DeleteMap deletes Map by Id and returns error if the record to be deleted doesn't exist
func DeleteMapDevice ¶
DeleteMapDevice deletes MapDevice by Id and returns error if the record to be deleted doesn't exist
func DeleteMapDeviceAction ¶
DeleteMapDeviceAction deletes MapDeviceAction by Id and returns error if the record to be deleted doesn't exist
func DeleteMapDeviceState ¶
DeleteMapDeviceState deletes MapDeviceState by Id and returns error if the record to be deleted doesn't exist
func DeleteMapElement ¶
DeleteMapElement deletes MapElement by Id and returns error if the record to be deleted doesn't exist
func DeleteMapImage ¶
DeleteMapImage deletes MapImage by Id and returns error if the record to be deleted doesn't exist
func DeleteMapLayer ¶
DeleteMapLayer deletes MapLayer by Id and returns error if the record to be deleted doesn't exist
func DeleteMapText ¶
DeleteMapText deletes MapText by Id and returns error if the record to be deleted doesn't exist
func DeleteNode ¶
DeleteNode deletes Node by Id and returns error if the record to be deleted doesn't exist
func DeletePermission ¶
DeletePermission deletes Permission by Id and returns error if the record to be deleted doesn't exist
func DeleteRole ¶
DeleteRole deletes Role by Name and returns error if the record to be deleted doesn't exist
func DeleteScript ¶
DeleteScript deletes Script by Id and returns error if the record to be deleted doesn't exist
func DeleteUser ¶
DeleteUser deletes User by Id and returns error if the record to be deleted doesn't exist
func DeleteUserMeta ¶
DeleteUserMeta deletes UserMeta by Id and returns error if the record to be deleted doesn't exist
func DeleteWorker ¶
DeleteWorker deletes Worker by Id and returns error if the record to be deleted doesn't exist
func DeleteWorkflow ¶
DeleteWorkflow deletes Workflow by Id and returns error if the record to be deleted doesn't exist
func EmailItemAddNew ¶
func EmailItemAddNew(body []byte) (id int64, b bool, valid validation.Validation, err error)
func EmailItemDelete ¶
func EmailItemGetSortedList ¶
func EmailItemParentUpdate ¶
func EmailItemUpdate ¶
func EmailItemUpdate(body []byte, item_name string) (id int64, b bool, valid validation.Validation, err error)
func EmailItemUpdateTree ¶
func EmailTemplateAddNew ¶
func EmailTemplateAddNew(body []byte) (id int64, b bool, valid validation.Validation, err error)
func EmailTemplateDelete ¶
func EmailTemplatePreview ¶
func EmailTemplatePreview(template *EmailTemplate) (buf string, err error)
func EmailTemplateUpdate ¶
func EmailTemplateUpdate(body []byte, name string) (b bool, valid validation.Validation, err error)
func FlowGetRelatedDate ¶
func GetAllConnection ¶
func GetAllConnection(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllConnection retrieves all Connection matches certain condition. Returns empty list if no records exist
func GetAllDashboard ¶
func GetAllDashboard(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllDashboard retrieves all Dashboard matches certain condition. Returns empty list if no records exist
func GetAllDevice ¶
func GetAllDevice(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllDevice retrieves all Device matches certain condition. Returns empty list if no records exist
func GetAllDeviceAction ¶
func GetAllDeviceAction(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllDeviceAction retrieves all DeviceAction matches certain condition. Returns empty list if no records exist
func GetAllDeviceState ¶
func GetAllDeviceState(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllDeviceState retrieves all DeviceState matches certain condition. Returns empty list if no records exist
func GetAllEmailItem ¶
func GetAllEmailItem(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllEmailTemplates retrieves all EmailItem matches certain condition. Returns empty list if no records exist
func GetAllFlow ¶
func GetAllFlow(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllFlow retrieves all Flow matches certain condition. Returns empty list if no records exist
func GetAllFlowElement ¶
func GetAllFlowElement(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllFlowElement retrieves all FlowElement matches certain condition. Returns empty list if no records exist
func GetAllImage ¶
func GetAllImage(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllImage retrieves all Image matches certain condition. Returns empty list if no records exist
func GetAllMap ¶
func GetAllMap(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllMap retrieves all Map matches certain condition. Returns empty list if no records exist
func GetAllMapDevice ¶
func GetAllMapDevice(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllMapDevice retrieves all MapDevice matches certain condition. Returns empty list if no records exist
func GetAllMapDeviceAction ¶
func GetAllMapDeviceAction(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllMapDeviceAction retrieves all MapDeviceAction matches certain condition. Returns empty list if no records exist
func GetAllMapDeviceState ¶
func GetAllMapDeviceState(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllMapDeviceState retrieves all MapDeviceState matches certain condition. Returns empty list if no records exist
func GetAllMapElement ¶
func GetAllMapElement(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllMapElement retrieves all MapElement matches certain condition. Returns empty list if no records exist
func GetAllMapImage ¶
func GetAllMapImage(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllMapImage retrieves all MapImage matches certain condition. Returns empty list if no records exist
func GetAllMapLayer ¶
func GetAllMapLayer(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllMapLayer retrieves all MapLayer matches certain condition. Returns empty list if no records exist
func GetAllMapText ¶
func GetAllMapText(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllMapText retrieves all MapText matches certain condition. Returns empty list if no records exist
func GetAllNode ¶
func GetAllNode(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllNode retrieves all Node matches certain condition. Returns empty list if no records exist
func GetAllPermission ¶
func GetAllPermission(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllPermission retrieves all Permission matches certain condition. Returns empty list if no records exist
func GetAllRole ¶
func GetAllRole(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllRole retrieves all Role matches certain condition. Returns empty list if no records exist
func GetAllScript ¶
func GetAllScript(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllScript retrieves all Script matches certain condition. Returns empty list if no records exist
func GetAllUser ¶
func GetAllUser(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllUser retrieves all User matches certain condition. Returns empty list if no records exist
func GetAllUserMeta ¶
func GetAllUserMeta(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllUserMeta retrieves all UserMeta matches certain condition. Returns empty list if no records exist
func GetAllWorker ¶
func GetAllWorker(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllWorker retrieves all Worker matches certain condition. Returns empty list if no records exist
func GetAllWorkflow ¶
func GetAllWorkflow(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, meta *map[string]int64, err error)
GetAllWorkflow retrieves all Workflow matches certain condition. Returns empty list if no records exist
func GetDevicesCount ¶
func GetNodesCount ¶
func GetUserMeta ¶
func InsertOrUpdateWorker ¶
func SetUserMeta ¶
func SortMapElements ¶
func SortMapElements(m []*MapElement) (err error)
func SortMapLayers ¶
func UpdateConnectionById ¶
func UpdateConnectionById(m *Connection) (err error)
UpdateConnection updates Connection by Id and returns error if the record to be updated doesn't exist
func UpdateDashboardById ¶
UpdateDashboard updates Dashboard by Id and returns error if the record to be updated doesn't exist
func UpdateDeviceActionById ¶
func UpdateDeviceActionById(m *DeviceAction) (err error)
UpdateDeviceAction updates DeviceAction by Id and returns error if the record to be updated doesn't exist
func UpdateDeviceById ¶
UpdateDevice updates Device by Id and returns error if the record to be updated doesn't exist
func UpdateDeviceStateById ¶
func UpdateDeviceStateById(m *DeviceState) (err error)
UpdateDeviceState updates DeviceState by Id and returns error if the record to be updated doesn't exist
func UpdateFlowById ¶
UpdateFlow updates Flow by Id and returns error if the record to be updated doesn't exist
func UpdateFlowElementById ¶
func UpdateFlowElementById(m *FlowElement) (err error)
UpdateFlowElement updates FlowElement by Id and returns error if the record to be updated doesn't exist
func UpdateImageById ¶
UpdateImage updates Image by Id and returns error if the record to be updated doesn't exist
func UpdateLogById ¶
UpdateLog updates Log by Id and returns error if the record to be updated doesn't exist
func UpdateMapById ¶
UpdateMap updates Map by Id and returns error if the record to be updated doesn't exist
func UpdateMapDeviceActionById ¶
func UpdateMapDeviceActionById(m *MapDeviceAction) (err error)
UpdateMapDeviceAction updates MapDeviceAction by Id and returns error if the record to be updated doesn't exist
func UpdateMapDeviceById ¶
UpdateMapDevice updates MapDevice by Id and returns error if the record to be updated doesn't exist
func UpdateMapDeviceStateById ¶
func UpdateMapDeviceStateById(m *MapDeviceState) (err error)
UpdateMapDeviceState updates MapDeviceState by Id and returns error if the record to be updated doesn't exist
func UpdateMapElementById ¶
func UpdateMapElementById(m *MapElement) (err error)
UpdateMapElement updates MapElement by Id and returns error if the record to be updated doesn't exist
func UpdateMapImageById ¶
UpdateMapImage updates MapImage by Id and returns error if the record to be updated doesn't exist
func UpdateMapLayerById ¶
UpdateMapLayer updates MapLayer by Id and returns error if the record to be updated doesn't exist
func UpdateMapTextById ¶
UpdateMapText updates MapText by Id and returns error if the record to be updated doesn't exist
func UpdateNodeById ¶
UpdateNode updates Node by Id and returns error if the record to be updated doesn't exist
func UpdatePermissionById ¶
func UpdatePermissionById(m *Permission) (err error)
UpdatePermission updates Permission by Id and returns error if the record to be updated doesn't exist
func UpdateRoleByName ¶
UpdateRole updates Role by Name and returns error if the record to be updated doesn't exist
func UpdateScriptById ¶
UpdateScript updates Script by Id and returns error if the record to be updated doesn't exist
func UpdateUserById ¶
UpdateUser updates User by Id and returns error if the record to be updated doesn't exist
func UpdateUserMetaById ¶
UpdateUserMeta updates UserMeta by Id and returns error if the record to be updated doesn't exist
func UpdateWorkerById ¶
UpdateWorker updates Worker by Id and returns error if the record to be updated doesn't exist
func UpdateWorkflowById ¶
UpdateWorkflow updates Workflow by Id and returns error if the record to be updated doesn't exist
Types ¶
type AccessItem ¶
type AccessLevels ¶
type AccessLevels map[string]AccessItem
func NewAccessLevels ¶
func NewAccessLevels() AccessLevels
type AccessList ¶
type AccessList map[string]AccessLevels
var AccessConfigList AccessList = nil
func NewAccessList ¶
func NewAccessList() AccessList
type Connection ¶
type Connection struct { Uuid string `orm:"pk" json:"uuid"` Name string `orm:"" json:"name"` ElementFrom string `orm:"column(element_from);type(string)" json:"element_from"` ElementTo string `orm:"column(element_to);type(string)" json:"element_to"` PointFrom int64 `orm:"column(point_from)" json:"point_from"` PointTo int64 `orm:"column(point_to)" json:"point_to"` FlowId int64 `orm:"column(flow_id)" json:"flow_id"` Direction string `orm:"" json:"direction"` GraphSettings string `orm:"column(graph_settings)" json:"graph_settings"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` Update_at time.Time `orm:"auto_now;type(datetime);column(update_at)" json:"update_at"` FlowElementFrom *FlowElement `orm:"-" json:"flow_elemet_from"` FlowElementTo *FlowElement `orm:"-" json:"flow_elemet_to"` Flow *Flow `orm:"-" json:"flow"` }
func GetConnectionById ¶
func GetConnectionById(id string) (v *Connection, err error)
GetConnectionById retrieves Connection by Id. Returns error if Id doesn't exist
func GetConnectionsByFlow ¶
func GetConnectionsByFlow(flow *Flow) (connections []*Connection, err error)
func (*Connection) TableName ¶
func (m *Connection) TableName() string
type Dashboard ¶
type Dashboard struct { Id int64 `orm:"pk;auto;column(id)" json:"id"` Name string `orm:"" json:"name" valid:"MaxSize(254);Required"` Description string `orm:"" json:"description"` Widgets string `orm:"" json:"widgets"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` Update_at time.Time `orm:"auto_now;type(datetime);column(update_at)" json:"update_at"` }
func GetDashboardById ¶
GetDashboardById retrieves Dashboard by Id. Returns error if Id doesn't exist
type Device ¶
type Device struct { Id int64 `orm:"pk;auto;column(id)" json:"id"` Device *Device `orm:"rel(fk);null" json:"device"` Node *Node `orm:"rel(fk);null" json:"node"` Address *int `orm:"" json:"address"` Baud int `orm:"size(11)" json:"baud"` Sleep int64 `orm:"size(32)" json:"sleep"` Description string `orm:"size(254)" json:"description" valid:"MaxSize(254)"` Name string `orm:"size(254)" json:"name" valid:"MaxSize(254);Required"` Status string `orm:"size(254)" json:"status" valid:"MaxSize(254)"` StopBite int64 `orm:"size(11)" json:"stop_bite"` Timeout time.Duration `orm:"" json:"timeout"` Tty string `orm:"size(254)" json:"tty" valid:"MaxSize(254)"` States []*DeviceState `orm:"reverse(many)" json:"states"` Actions []*DeviceAction `orm:"reverse(many)" json:"actions"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` Update_at time.Time `orm:"auto_now;type(datetime);column(update_at)" json:"update_at"` IsGroup bool `orm:"-" json:"is_group"` }
func GetDeviceById ¶
GetDeviceById retrieves Device by Id. Returns error if Id doesn't exist
func (*Device) GetInheritedData ¶
type DeviceAction ¶
type DeviceAction struct { Id int64 `orm:"pk;auto;column(id)" json:"id"` Device *Device `orm:"rel(fk)" json:"device"` //Command string `orm:"" json:"command" valid:"Required"` Name string `orm:"size(254)" json:"name" valid:"MaxSize(254);Required"` Description string `orm:"" json:"description"` Script *Script `orm:"rel(fk);null" json:"script"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` Update_at time.Time `orm:"auto_now;type(datetime);column(update_at)" json:"update_at"` }
func GetAllDeviceActionByDevice ¶
func GetAllDeviceActionByDevice(id int64) (actions []*DeviceAction, err error)
func GetDeviceActionById ¶
func GetDeviceActionById(id int64) (v *DeviceAction, err error)
GetDeviceActionById retrieves DeviceAction by Id. Returns error if Id doesn't exist
func GetDeviceActionsByDeviceId ¶
func GetDeviceActionsByDeviceId(ids []int64) (actions []*DeviceAction, err error)
func (*DeviceAction) TableName ¶
func (m *DeviceAction) TableName() string
type DeviceState ¶
type DeviceState struct { Id int64 `orm:"pk;auto;column(id)" json:"id"` Device *Device `orm:"rel(fk);null" json:"device"` Description string `orm:"size(254)" json:"description" valid:"MaxSize(254)"` SystemName string `orm:"size(254)" json:"system_name" valid:"MaxSize(254);Required"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` Update_at time.Time `orm:"auto_now;type(datetime);column(update_at)" json:"update_at"` }
func GetAllDeviceStateByDevice ¶
func GetAllDeviceStateByDevice(id int64) (states []*DeviceState, err error)
DeleteDeviceState
func GetDeviceStateById ¶
func GetDeviceStateById(id int64) (v *DeviceState, err error)
GetDeviceStateById retrieves DeviceState by Id. Returns error if Id doesn't exist
func (*DeviceState) TableName ¶
func (i *DeviceState) TableName() string
type EmailItem ¶
type EmailItem struct { Name string `orm:"pk;size(64);column(name);unique" valid:"Required;MaxSize(64)" json:"name"` Description string `orm:"size(255)" json:"description"` Content string `orm:"" json:"content"` Status string `orm:"size(64)" valid:"Required;MaxSize(64)" json:"status"` //active, inactive Type string `orm:"size(64)" valid:"Required;MaxSize(64)" json:"type"` //item, template Parent string `orm:"size(64)" valid:"MaxSize(64)" json:"parent"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` Updated_at time.Time `orm:"auto_now;type(datetime);column(updated_at)" json:"updated_at"` }
func EmailItemGet ¶
func EmailTemplateGetByName ¶
func (*EmailItem) GetTemplate ¶
func (i *EmailItem) GetTemplate() (tpl *EmailTemplate, err error)
type EmailRender ¶
func EmailTemplateRender ¶
func EmailTemplateRender(name string, params map[string]interface{}) (r *EmailRender, err error)
type EmailTemplate ¶
type Flow ¶
type Flow struct { Id int64 `orm:"pk;auto;column(id)" json:"id"` Name string `orm:"" json:"name"` Description string `orm:"" json:"description"` Status string `orm:"" json:"status"` Workflow *Workflow `orm:"rel(fk)" json:"workflow"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` Update_at time.Time `orm:"auto_now;type(datetime);column(update_at)" json:"update_at"` Connections []*Connection `orm:"-" json:"connections"` FlowElements []*FlowElement `orm:"-" json:"flow_elements"` Workers []*Worker `orm:"-" json:"workers"` }
func GetAllEnabledFlows ¶
func GetAllEnabledFlowsByWf ¶
func GetEnabledFlowById ¶
func GetFlowById ¶
GetFlowById retrieves Flow by Id. Returns error if Id doesn't exist
func GetFullFlowById ¶
GetFlowById retrieves Flow by Id. Returns error if Id doesn't exist
func (*Flow) AddConnection ¶
func (f *Flow) AddConnection(connection *Connection)
func (*Flow) GetAllEnabledWorkers ¶
func (*Flow) GetWorkers ¶
type FlowElement ¶
type FlowElement struct { Uuid string `orm:"pk" json:"uuid"` Script *Script `orm:"rel(fk);null" json:"script"` Name string `orm:"" json:"name"` Description string `orm:"" json:"description"` GraphSettings string `orm:"column(graph_settings)" json:"graph_settings"` Status string `orm:"" json:"status"` FlowId int64 `orm:"column(flow_id)" json:"flow_id"` FlowLink sql.NullInt64 `orm:"column(flow_link)" json:"flow"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` Update_at time.Time `orm:"auto_now;type(datetime);column(update_at)" json:"update_at"` PrototypeType string `orm:"column(prototype_type)" json:"prototype_type"` }
func GetFlowElementById ¶
func GetFlowElementById(uuid string) (v *FlowElement, err error)
GetFlowElementById retrieves FlowElement by Id. Returns error if Id doesn't exist
func GetFlowElementsByFlow ¶
func GetFlowElementsByFlow(flow *Flow) (elements []*FlowElement, err error)
func (*FlowElement) TableName ¶
func (m *FlowElement) TableName() string
type Image ¶
type Image struct { Id int64 `orm:"pk;auto;column(id)" json:"id"` Thumb string `orm:"" json:"thumb"` Url string `orm:"-" json:"url"` Image string `orm:"" json:"image"` MimeType string `orm:"" json:"mime_type"` Title string `orm:"" json:"title"` Size int64 `orm:"" json:"size"` Name string `orm:"" json:"name"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` }
func GetAllImagesByDate ¶
GetAllImagesByDate
func GetImageById ¶
GetImageById retrieves Image by Id. Returns error if Id doesn't exist
func UploadImages ¶
func UploadImages(files map[string][]*multipart.FileHeader) (fileList []*Image, errs []error)
type Log ¶
type Log struct { Id int64 `orm:"pk;auto;column(id)" json:"id"` Body string `orm:"" json:"body"` Level string `orm:"" json:"level"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` }
func GetAllLog ¶
func GetAllLog(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (logs []Log, meta *map[string]int64, err error)
GetAllLog retrieves all Log matches certain condition. Returns empty list if no records exist
func GetLogById ¶
GetLogById retrieves Log by Id. Returns error if Id doesn't exist
type Map ¶
type Map struct { Id int64 `orm:"pk;auto;column(id)" json:"id"` Name string `orm:"" json:"name" valid:"MaxSize(254);Required"` Description string `orm:"" json:"description"` Layers []*MapLayer `orm:"reverse(many)" json:"layers"` Options string `orm:"" json:"options"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` Update_at time.Time `orm:"auto_now;type(datetime);column(update_at)" json:"update_at"` }
func GetMapById ¶
GetMapById retrieves Map by Id. Returns error if Id doesn't exist
type MapDevice ¶
type MapDevice struct { Id int64 `orm:"pk;auto;column(id)" json:"id"` Device *Device `orm:"rel(fk)" json:"device"` Image *Image `orm:"rel(fk);null" json:"image"` States []*MapDeviceState `orm:"reverse(many)" json:"states"` Actions []*MapDeviceAction `orm:"reverse(many)" json:"actions"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` Update_at time.Time `orm:"auto_now;type(datetime);column(update_at)" json:"update_at"` }
func GetMapDeviceById ¶
GetMapDeviceById retrieves MapDevice by Id. Returns error if Id doesn't exist
type MapDeviceAction ¶
type MapDeviceAction struct { Id int64 `orm:"pk;auto;column(id)" json:"id"` Type string `orm:"" json:"type"` MapDevice *MapDevice `orm:"rel(fk)" json:"map_device"` DeviceAction *DeviceAction `orm:"rel(fk)" json:"device_action"` Image *Image `orm:"rel(fk);null" json:"image"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` Update_at time.Time `orm:"auto_now;type(datetime);column(update_at)" json:"update_at"` }
func GetMapDeviceActionById ¶
func GetMapDeviceActionById(id int64) (v *MapDeviceAction, err error)
GetMapDeviceActionById retrieves MapDeviceAction by Id. Returns error if Id doesn't exist
func (*MapDeviceAction) TableName ¶
func (m *MapDeviceAction) TableName() string
type MapDeviceState ¶
type MapDeviceState struct { Id int64 `orm:"pk;auto;column(id)" json:"id"` Style string `orm:"" json:"style"` MapDevice *MapDevice `orm:"rel(fk)" json:"map_device"` DeviceState *DeviceState `orm:"rel(fk)" json:"device_state"` Image *Image `orm:"rel(fk);null" json:"image"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` Update_at time.Time `orm:"auto_now;type(datetime);column(update_at)" json:"update_at"` }
func GetMapDeviceStateById ¶
func GetMapDeviceStateById(id int64) (v *MapDeviceState, err error)
GetMapDeviceStateById retrieves MapDeviceState by Id. Returns error if Id doesn't exist
func (*MapDeviceState) TableName ¶
func (m *MapDeviceState) TableName() string
type MapElement ¶
type MapElement struct { Id int64 `orm:"pk;auto;column(id)" json:"id"` Name string `orm:"" json:"name"` Description string `orm:"" json:"description"` Status string `orm:"" json:"status"` PrototypeType string `orm:"" json:"prototype_type"` PrototypeId int64 `orm:"" json:"prototype_id"` Prototype interface{} `orm:"-" json:"prototype"` Weight int64 `orm:"" json:"weight"` Layer *MapLayer `orm:"rel(fk)" json:"layer"` Map *Map `orm:"rel(fk)" json:"map"` GraphSettings string `orm:"column(graph_settings)" json:"graph_settings"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` Update_at time.Time `orm:"auto_now;type(datetime);column(update_at)" json:"update_at"` }
func GetMapElementById ¶
func GetMapElementById(id int64) (v *MapElement, err error)
GetMapElementById retrieves MapElement by Id. Returns error if Id doesn't exist
func (*MapElement) CompareWith ¶
func (m *MapElement) CompareWith(element *MapElement) bool
func (*MapElement) GetPrototype ¶
func (m *MapElement) GetPrototype() (*MapElement, error)
func (*MapElement) TableName ¶
func (m *MapElement) TableName() string
type MapImage ¶
type MapImage struct { Id int64 `orm:"pk;auto;column(id)" json:"id"` Image *Image `orm:"rel(fk)" json:"image"` Style string `orm:"" json:"style"` }
func GetMapImageById ¶
GetMapImageById retrieves MapImage by Id. Returns error if Id doesn't exist
type MapLayer ¶
type MapLayer struct { Id int64 `orm:"pk;auto;column(id)" json:"id"` Name string `orm:"" json:"name"` Status string `orm:"" json:"status"` Description string `orm:"" json:"description"` Weight int64 `orm:"" json:"weight"` Map *Map `orm:"rel(fk)" json:"map"` Elements []*MapElement `orm:"reverse(many)" json:"elements"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` Update_at time.Time `orm:"auto_now;type(datetime);column(update_at)" json:"update_at"` }
func GetMapLayerById ¶
GetMapLayerById retrieves MapLayer by Id. Returns error if Id doesn't exist
type MapText ¶
type MapText struct { Id int64 `orm:"pk;auto;column(id)" json:"id"` Text string `orm:"" json:"text"` Style string `orm:"" json:"style"` }
func GetMapTextById ¶
GetMapTextById retrieves MapText by Id. Returns error if Id doesn't exist
type Node ¶
type Node struct { Id int64 `orm:"pk;auto;column(id)" json:"id"` Name string `orm:"size(254)" json:"name" valid:"MaxSize(254);Required"` Ip string `orm:"size(128)" json:"ip" valid:"IP;Required"` // Must be a valid IPv4 address Port int `orm:"size(11)" json:"port" valid:"Range(1, 65535);Required"` Status string `orm:"size(254)" json:"status"` Description string `orm:"type(longtext)" json:"description"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` Update_at time.Time `orm:"auto_now;type(datetime);column(update_at)" json:"update_at"` Errors int64 `orm:"-" json:"-"` // contains filtered or unexported fields }
func GetAllEnabledNodes ¶
func GetNodeById ¶
GetNodeById retrieves Node by Id. Returns error if Id doesn't exist
func (*Node) GetConnectStatus ¶
func (*Node) GetVersion ¶
func (*Node) ModbusSend ¶
func (*Node) SetConnectStatus ¶
func (*Node) Valid ¶
func (n *Node) Valid(v *validation.Validation)
type Permission ¶
type Permission struct { Id int64 `orm:"pk;auto" json:"id"` Role *Role `orm:"rel(fk);column(role_name)" json:"-"` PackageName string `orm:"" json:"package_name"` LevelName string `orm:"" json:"level_name"` }
func GetPermissionById ¶
func GetPermissionById(id int64) (v *Permission, err error)
GetPermissionById retrieves Permission by Id. Returns error if Id doesn't exist
func (*Permission) TableName ¶
func (m *Permission) TableName() string
type RedactorConnector ¶
type RedactorConnector struct { Id string `json:"id"` Start struct { Object string `json:"object"` Point int64 `json:"point"` } `json:"start"` End struct { Object string `json:"object"` Point int64 `json:"point"` } `json:"end"` Flow_type string `json:"flow_type"` Title string `json:"title"` Direction string `json:"direction"` }
type RedactorFlow ¶
type RedactorFlow struct { Id int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` Status string `json:"status"` Objects []*RedactorObject `json:"objects"` Connectors []*RedactorConnector `json:"connectors"` Created_at time.Time `json:"created_at"` Update_at time.Time `json:"update_at"` Workflow *Workflow `json:"workflow"` Workers []*Worker `json:"workers"` }
type RedactorGrapSettings ¶
type RedactorObject ¶
type RedactorObject struct { Id string `json:"id"` Type struct { Name string `json:"name"` Start interface{} `json:"start"` End interface{} `json:"end"` Status string `json:"status"` Action string `json:"action"` } `json:"type"` Position struct { Top int64 `json:"top"` Left int64 `json:"left"` } `json:"position"` Status string `json:"status"` Error string `json:"error"` Title string `json:"title"` Description string `json:"description"` PrototypeType string `json:"prototype_type"` Script *Script `json:"script"` FlowLink *Flow `json:"flow_link"` }
type Role ¶
type Role struct { Name string `orm:"pk;unique;size(255);index" valid:"Required;MaxSize(255)" json:"name"` Description string `orm:"size(255)" json:"description"` Parent *Role `orm:"rel(fk);column(parent);null" json:"parent"` Children []*Role `orm:"reverse(many)" json:"children"` Permissions []*Permission `orm:"reverse(many)" json:"-"` AccessList map[string][]string `orm:"-" json:"access_list"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` Update_at time.Time `orm:"auto_now;type(datetime);column(update_at)" json:"update_at"` }
func GetRoleByName ¶
GetRoleById retrieves Role by Name. Returns error if Name doesn't exist
func (*Role) GetAccessList ¶
func (r *Role) GetAccessList()
func (*Role) GetFullAccessList ¶
func (r *Role) GetFullAccessList() (access_list AccessList)
func (*Role) LoadRelated ¶
type Script ¶
type Script struct { Id int64 `orm:"pk;auto;column(id)" json:"id"` Name string `orm:"size(254)" json:"name" valid:"MaxSize(254);Required"` Source string `orm:"type(longtext)" json:"source"` Compiled string `orm:"type(longtext)" json:"-"` Lang string `orm:"size(254)" json:"lang"` Description string `orm:"type(longtext)" json:"description"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` Update_at time.Time `orm:"auto_now;type(datetime);column(update_at)" json:"update_at"` }
func GetScriptById ¶
GetScriptById retrieves Script by Id. Returns error if Id doesn't exist
type SortMapElementByWeight ¶
type SortMapElementByWeight []*MapElement
func (SortMapElementByWeight) Len ¶
func (l SortMapElementByWeight) Len() int
func (SortMapElementByWeight) Less ¶
func (l SortMapElementByWeight) Less(i, j int) bool
func (SortMapElementByWeight) Swap ¶
func (l SortMapElementByWeight) Swap(i, j int)
type SortMapLayersByWeight ¶
type SortMapLayersByWeight []*MapLayer
func (SortMapLayersByWeight) Len ¶
func (l SortMapLayersByWeight) Len() int
func (SortMapLayersByWeight) Less ¶
func (l SortMapLayersByWeight) Less(i, j int) bool
func (SortMapLayersByWeight) Swap ¶
func (l SortMapLayersByWeight) Swap(i, j int)
type Tree ¶
type Tree struct { Name string `json:"name"` Description string `json:"description"` Status string `json:"status"` Nodes []*Tree `json:"nodes"` }
func EmailItemGetTree ¶
type User ¶
type User struct { Id int64 `orm:"pk;auto" json:"id"` Nickname string `orm:"size(255)" valid:"Required;MinSize(3);MaxSize(255)" json:"nickname"` FirstName string `orm:"size(255)" valid:"MaxSize(255)" json:"first_name"` LastName string `orm:"size(255)" valid:"MaxSize(255)" json:"last_name"` EncryptedPassword string `orm:"size(255)" valid:"Required;MaxSize(255)" json:"-"` Email string `orm:"size(255)" valid:"Required;Email" json:"email"` History string `orm:"" json:"history"` Status string `orm:"size(255);default(blocked)" valid:"MaxSize(255)" json:"status"` //active, blocked ResetPasswordToken string `orm:"size(255)" json:"-"` AuthenticationToken string `orm:"size(255)" valid:"MaxSize(255)" json:"-"` Avatar *Image `orm:"rel(fk);null;column(image_id)" json:"avatar"` SignInCount int64 `orm:"size(11)" json:"sign_in_count"` CurrentSignInIp string `orm:"size(255);default(null)" json:"current_sign_in_ip"` LastSignInIp string `orm:"size(255);default(null)" json:"last_sign_in_ip"` CreatedBy *User `orm:"rel(fk);null;column(user_id)" json:"created_by"` Role *Role `orm:"rel(fk);null;column(role_name)" json:"role"` Meta []*UserMeta `orm:"reverse(many);null" json:"meta"` ResetPasswordSentAt time.Time `orm:"type(datetime)" json:"-"` CurrentSignInAt time.Time `orm:"type(datetime);null;default(null)" json:"current_sign_in_at"` LastSignInAt time.Time `orm:"type(datetime);null;default(null)" json:"last_sign_in_at"` Created_at time.Time `orm:"auto_now_add;type(datetime)" json:"created_at"` Update_at time.Time `orm:"auto_now;type(datetime)" json:"update_at"` Deleted time.Time `orm:"type(datetime);null;default(null)" json:"deleted"` }
func GetUserById ¶
GetUserById retrieves User by Id. Returns error if Id doesn't exist
func UserGetByEmail ¶
func UserGetByResetPassToken ¶
func (*User) ClearResetPassToken ¶
func (*User) GenResetPassToken ¶
func (*User) GetHistory ¶
func (u *User) GetHistory() (history []*UserHistory, err error)
func (*User) LoadRelated ¶
func (*User) UpdatePassword ¶
type UserHistory ¶
type UserMeta ¶
type UserMeta struct { Id int64 `orm:"pk;auto" json:"id"` User *User `orm:"rel(fk)" json:"-"` Key string `orm:"size(255)" valid:"MaxSize(255)" json:"key"` Value string `orm:"size(255)" valid:"MaxSize(255)" json:"value"` }
func GetUserMetaById ¶
GetUserMetaById retrieves UserMeta by Id. Returns error if Id doesn't exist
type Worker ¶
type Worker struct { Id int64 `orm:"pk;auto;column(id)" json:"id"` Workflow *Workflow `orm:"rel(fk)" json:"workflow" valid:"Required"` DeviceAction *DeviceAction `orm:"rel(fk);column(device_action_id);null" json:"device_action"` Flow *Flow `orm:"rel(fk)" json:"flow" valid:"Required"` Status string `orm:"size(254)" json:"status" valid:"Required"` Name string `orm:"size(254)" json:"name" valid:"MaxSize(254);Required"` Time string `orm:"size(254)" json:"time"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` Update_at time.Time `orm:"auto_now;type(datetime);column(update_at)" json:"update_at"` }
func GetWorkerById ¶
GetWorkerById retrieves Worker by Id. Returns error if Id doesn't exist
func GetWorkersByDeviceAction ¶
func GetWorkersByDeviceAction(device_action *DeviceAction) (workers []*Worker, err error)
func GetWorkersByFlow ¶
func GetWorkersByFlowId ¶
type Workflow ¶
type Workflow struct { Id int64 `orm:"pk;auto;column(id)" json:"id"` Name string `orm:"" json:"name"` Description string `orm:"" json:"description"` Status string `orm:"" json:"status"` Flows []*Flow `orm:"-" json:"flows"` Created_at time.Time `orm:"auto_now_add;type(datetime);column(created_at)" json:"created_at"` Update_at time.Time `orm:"auto_now;type(datetime);column(update_at)" json:"update_at"` }
func GetAllEnabledWorkflow ¶
func GetWorkflowById ¶
GetWorkflowById retrieves Workflow by Id. Returns error if Id doesn't exist
func (*Workflow) GetAllEnabledFlows ¶
func (*Workflow) GetAllEnabledWorkers ¶
Source Files ¶
- accessconfig.go
- accessitems.go
- connection.go
- dashboard.go
- device.go
- deviceaction.go
- devicestate.go
- emailitem.go
- emailtemplate.go
- flow.go
- flowelement.go
- image.go
- log.go
- map.go
- mapdevice.go
- mapdeviceaction.go
- mapdevicestate.go
- mapelement.go
- mapimage.go
- maplayer.go
- maptext.go
- node.go
- permission.go
- redactor.go
- role.go
- script.go
- user.go
- userhistory.go
- usermeta.go
- worker.go
- workflow.go