Documentation
¶
Index ¶
- func AddDevicePermissionForRoles(device entity.Device, tx *gorm.DB) (err error)
- func BatchInsertChildDevice(d *entity.Device, das plugin.DeviceInstances, tx *gorm.DB) error
- func ControlPermissions(d entity.Device) ([]types.Permission, error)
- func Create(areaID uint64, device *entity.Device) (err error)
- func GetControlAttributes(d entity.Device) (attributes []entity.Attribute, err error)
- func GetDeviceInstances(d entity.Device, up entity.UserPermissions) (das plugin.DeviceInstances, err error)
- func GetInstances(areaID uint64, userID int, pluginID, identity string) (das plugin.DeviceInstances, err error)
- func GetOrInitDeviceInstances(d entity.Device, up entity.UserPermissions) (das plugin.DeviceInstances, err error)
- func GetShadow(d entity.Device) (shadow entity.Shadow, err error)
- func GetThingModel(d entity.Device) (thingModel plugin.DeviceInstances, err error)
- func GetUserDeviceInstances(userID int, d entity.Device) (das plugin.DeviceInstances, err error)
- func IsDeviceControlPermit(areaID uint64, userID int, pluginID, identity string, data json.RawMessage) bool
- func IsPermit(c *gin.Context, p types.Permission) bool
- func ManagePermissions(d entity.Device) []types.Permission
- func Permissions(d entity.Device) (ps []types.Permission, err error)
- func SyncDevice(d *entity.Device) (err error)
- func UpdateDeviceShadow(em event.EventMessage) error
- func UpdateShadowReported(d entity.Device, attr entity.Attribute) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDevicePermissionForRoles ¶
AddDevicePermissionForRoles 为所有角色增加设备权限
func BatchInsertChildDevice ¶ added in v1.9.1
BatchInsertChildDevice 通过das批量插入子设备
func ControlPermissions ¶
func ControlPermissions(d entity.Device) ([]types.Permission, error)
ControlPermissions 根据配置获取设备所有控制权限
func GetControlAttributes ¶ added in v1.9.1
GetControlAttributes 获取设备属性(不包括设备型号、厂商等属性)
func GetDeviceInstances ¶ added in v1.9.1
func GetDeviceInstances(d entity.Device, up entity.UserPermissions) (das plugin.DeviceInstances, err error)
GetDeviceInstances 获取设备的instance
func GetInstances ¶ added in v1.9.1
func GetInstances(areaID uint64, userID int, pluginID, identity string) (das plugin.DeviceInstances, err error)
GetInstances 获取用户设备的属性(包括权限)
func GetOrInitDeviceInstances ¶ added in v1.9.1
func GetOrInitDeviceInstances(d entity.Device, up entity.UserPermissions) (das plugin.DeviceInstances, err error)
func GetThingModel ¶ added in v1.9.1
func GetThingModel(d entity.Device) (thingModel plugin.DeviceInstances, err error)
func GetUserDeviceInstances ¶ added in v1.9.1
GetUserDeviceInstances 获取用户设备的属性(包括权限)
func IsDeviceControlPermit ¶
func IsDeviceControlPermit(areaID uint64, userID int, pluginID, identity string, data json.RawMessage) bool
IsDeviceControlPermit 控制设备的websocket命令 是否有权限
func ManagePermissions ¶
func ManagePermissions(d entity.Device) []types.Permission
ManagePermissions 设备的管理权限
func Permissions ¶
func Permissions(d entity.Device) (ps []types.Permission, err error)
Permissions 根据配置获取设备所有权限
func UpdateDeviceShadow ¶ added in v1.9.1
func UpdateDeviceShadow(em event.EventMessage) error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.