Documentation ¶
Overview ¶
Copyright (C) 2023 wwhai
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- func AllAiBase() []model.MAiBase
- func AllApp() []model.MApp
- func AllDataSchema() []model.MDataSchema
- func AllDevices() []model.MDevice
- func AllEnabledCronTask() []model.MCronTask
- func AllGenericGroup() []model.MGenericGroup
- func AllGoods() []model.MGoods
- func AllHwPort() ([]model.MHwPort, error)
- func AllInternalNotifies() []model.MInternalNotify
- func AllInternalNotifiesHeader() []model.MInternalNotify
- func AllMInEnd() []model.MInEnd
- func AllMOutEnd() []model.MOutEnd
- func AllMRules() []model.MRule
- func AllMUser() []model.MUser
- func AllUserLuaTemplate() []model.MUserLuaTemplate
- func AllVisual() []model.MVisual
- func BindResource(gid, rid string) error
- func CheckAlreadyBinding(gid, rid string) (uint, error)
- func CheckBindResource(gid string) (uint, error)
- func CheckIfAlreadyInitNetWorkConfig() bool
- func CheckIfAlreadyInitWlanConfig() bool
- func CleanGoodsUpload() error
- func CleanThumbnailUpload() error
- func ClearInternalNotifies() error
- func CountModel(m any) int64
- func CountTable(table string) int64
- func CreateScheduleTask(data *dto.CronTaskCreateDTO) (*model.MCronTask, error)
- func DeleteAiBase(uuid string) error
- func DeleteAllModbusPointByDevice(deviceUuid string) error
- func DeleteAllSiemensPointByDevice(deviceUuid string) error
- func DeleteApp(uuid string) error
- func DeleteDataSchema(uuid string) error
- func DeleteDevice(uuid string) error
- func DeleteGenericGroup(uuid string) error
- func DeleteGoods(uuid string) error
- func DeleteMInEnd(uuid string) error
- func DeleteMOutEnd(uuid string) error
- func DeleteMRule(uuid string) error
- func DeleteModbusPointByDevice(uuids []string, deviceUuid string) error
- func DeleteScheduleTask(uuid string) error
- func DeleteSiemensPointByDevice(uuids []string, deviceUuid string) error
- func DeleteUserLuaTemplate(uuid string) error
- func DeleteVisual(uuid string) error
- func EtcApply() error
- func FindDeviceByGroup(uuid string) []model.MDevice
- func FindUserTemplateByGroup(uuid string) []model.MUserLuaTemplate
- func FindVisualByGroup(uuid string) []model.MVisual
- func GetAiBaseWithUUID(uuid string) (*model.MAiBase, error)
- func GetAllMRule() ([]model.MRule, error)
- func GetAllNetConfig() ([]model.MNetworkConfig, error)
- func GetDataSchemaWithUUID(uuid string) (*model.MDataSchema, error)
- func GetDefaultIpRoute() (model.MIpRoute, error)
- func GetEth0Config() (model.MNetworkConfig, error)
- func GetEth1Config() (model.MNetworkConfig, error)
- func GetGenericGroupWithUUID(uuid string) (*model.MGenericGroup, error)
- func GetGoodsWithUUID(uuid string) (*model.MGoods, error)
- func GetHwPortConfig(uuid string) (model.MHwPort, error)
- func GetMAppWithUUID(uuid string) (*model.MApp, error)
- func GetMDeviceWithUUID(uuid string) (*model.MDevice, error)
- func GetMInEnd(uuid string) (*model.MInEnd, error)
- func GetMInEndWithUUID(uuid string) (*model.MInEnd, error)
- func GetMOutEnd(id string) (*model.MOutEnd, error)
- func GetMOutEndWithUUID(uuid string) (*model.MOutEnd, error)
- func GetMRule(uuid string) (*model.MRule, error)
- func GetMRuleWithUUID(uuid string) (*model.MRule, error)
- func GetMUser(username string) (*model.MUser, error)
- func GetMemPercent() (float64, error)
- func GetOsPort() []string
- func GetSiteConfig() (model.MSiteConfig, error)
- func GetUserLuaTemplateGroup(rid string) model.MGenericGroup
- func GetUserLuaTemplateWithUUID(uuid string) (model.MUserLuaTemplate, error)
- func GetVisualGroup(rid string) model.MGenericGroup
- func GetVisualWithUUID(uuid string) (model.MVisual, error)
- func GetWlan0Config() (model.MWifiConfig, error)
- func InitDefaultIpRoute() error
- func InitGenericGroup(GenericGroup *model.MGenericGroup) error
- func InitHwPortConfig() error
- func InitMUser(o *model.MUser) error
- func InitNetWorkConfig() error
- func InitSiteConfig(SiteConfig model.MSiteConfig) error
- func InitWlanConfig() error
- func InsertAiBase(AiBase *model.MAiBase) error
- func InsertApp(app *model.MApp) error
- func InsertDataSchema(DataSchema model.MDataSchema) error
- func InsertDevice(o *model.MDevice) error
- func InsertGenericGroup(GenericGroup *model.MGenericGroup) error
- func InsertGoods(goods *model.MGoods) error
- func InsertInternalNotify(m model.MInternalNotify) error
- func InsertMInEnd(i *model.MInEnd) error
- func InsertMOutEnd(o *model.MOutEnd) error
- func InsertMRule(r *model.MRule) error
- func InsertMUser(o *model.MUser) error
- func InsertModbusPointPosition(P model.MModbusDataPoint) error
- func InsertModbusPointPositions(list []model.MModbusDataPoint) error
- func InsertSiemensPointPosition(P model.MSiemensDataPoint) error
- func InsertSiemensPointPositions(list []model.MSiemensDataPoint) error
- func InsertUserLuaTemplate(UserLuaTemplate model.MUserLuaTemplate) error
- func InsertVisual(Visual model.MVisual) error
- func IpRouteDetail() (model.MIpRoute, error)
- func ListByGroupType(t string) []model.MGenericGroup
- func ListScheduleTask(task model.MCronTask) (any, error)
- func Login(username, pwd string) (*model.MUser, error)
- func NetplanApply() error
- func Paginate(page model.PageRequest) func(db *gorm.DB) *gorm.DB
- func ReBindResource(action func(tx *gorm.DB) error, Rid, Gid string) error
- func ReadInternalNotifies(uuid string) error
- func ReadPageRequest(c *gin.Context) (*model.PageRequest, error)
- func RestartNetworkManager() error
- func SearchUserLuaTemplate(label, detail string) []model.MUserLuaTemplate
- func TruncateConfig() error
- func TruncateWifiConfig() error
- func UnBindResource(gid, rid string) error
- func UpdateAiBase(AiBase *model.MAiBase) error
- func UpdateApp(app *model.MApp) error
- func UpdateDataSchema(DataSchema model.MDataSchema) error
- func UpdateDefaultRoute(newGatewayIP, newIface string) error
- func UpdateDevice(uuid string, o *model.MDevice) error
- func UpdateEth0Config(MNetworkConfig model.MNetworkConfig) error
- func UpdateEth1Config(MNetworkConfig model.MNetworkConfig) error
- func UpdateGenericGroup(GenericGroup *model.MGenericGroup) error
- func UpdateGoods(goods model.MGoods) error
- func UpdateHwPortConfig(MHwPort model.MHwPort) error
- func UpdateIpRoute(IpRoute model.MIpRoute) error
- func UpdateMInEnd(uuid string, i *model.MInEnd) error
- func UpdateMOutEnd(uuid string, o *model.MOutEnd) error
- func UpdateMRule(uuid string, r *model.MRule) error
- func UpdateMUser(o *model.MUser) error
- func UpdateModbusPoint(MModbusDataPoint model.MModbusDataPoint) error
- func UpdateScheduleTask(data *dto.CronTaskUpdateDTO) (*model.MCronTask, error)
- func UpdateSiemensPoint(MSiemensDataPoint model.MSiemensDataPoint) error
- func UpdateSiteConfig(SiteConfig model.MSiteConfig) error
- func UpdateUserLuaTemplate(UserLuaTemplate model.MUserLuaTemplate) error
- func UpdateVisual(Visual model.MVisual) error
- func UpdateWlan0Config(MNetworkConfig model.MWifiConfig) error
- func WrapPageResult(page model.PageRequest, records any, count int64) model.PageResult
- type HwPortDto
- type UartConfigDto
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllDevices ¶
func AllMOutEnd ¶
func AllMRules ¶
-----------------------------------------------------------------------------------
func CheckIfAlreadyInitNetWorkConfig ¶
func CheckIfAlreadyInitNetWorkConfig() bool
* * 检查一下是否已经初始化过了,避免覆盖配置 *
func CreateScheduleTask ¶
func CreateScheduleTask(data *dto.CronTaskCreateDTO) (*model.MCronTask, error)
func DeleteAllModbusPointByDevice ¶
DeleteAllModbusPointByDevice 删除modbus点位与设备
func DeleteAllSiemensPointByDevice ¶
DeleteAllSiemensPointByDevice 删除Siemens点位与设备
func DeleteMInEnd ¶
func DeleteMOutEnd ¶
func DeleteMRule ¶
func DeleteModbusPointByDevice ¶
DeleteModbusPointByDevice 删除modbus点位与设备
func DeleteScheduleTask ¶
func DeleteSiemensPointByDevice ¶
DeleteSiemensPointByDevice 删除Siemens点位与设备
func FindUserTemplateByGroup ¶
func FindUserTemplateByGroup(uuid string) []model.MUserLuaTemplate
*
- 根据分组类型查询:代码模板
*~
func GetAllMRule ¶
func GetAllNetConfig ¶
func GetAllNetConfig() ([]model.MNetworkConfig, error)
* * 匹配: /etc/network/interfaces *
func GetDataSchemaWithUUID ¶
func GetDataSchemaWithUUID(uuid string) (*model.MDataSchema, error)
func GetDefaultIpRoute ¶
func GetGenericGroupWithUUID ¶
func GetGenericGroupWithUUID(uuid string) (*model.MGenericGroup, error)
func GetMInEnd ¶
-----------------------------------------------------------------------------------
func GetMOutEnd ¶
-----------------------------------------------------------------------------------
func GetMUser ¶
----------------------------------------------------------------------------------- USER -----------------------------------------------------------------------------------
func GetMemPercent ¶
func GetOsPort ¶
func GetOsPort() []string
* * 获取系统串口, 这个接口比较特殊,当运行在特殊硬件上的时候,某些系统占用的直接不显示 * 这个接口需要兼容各类特殊硬件
func GetSiteConfig ¶
func GetSiteConfig() (model.MSiteConfig, error)
func GetUserLuaTemplateGroup ¶
func GetUserLuaTemplateGroup(rid string) model.MGenericGroup
* * 获取分组 *
func GetUserLuaTemplateWithUUID ¶
func GetUserLuaTemplateWithUUID(uuid string) (model.MUserLuaTemplate, error)
* * ID获取 *
func GetVisualGroup ¶
func GetVisualGroup(rid string) model.MGenericGroup
func InitDefaultIpRoute ¶
func InitDefaultIpRoute() error
每次启动的时候换成最新配置的路由, 默认是ETH1 192.168.64.0 这个初始化的目的是为了配合软路由使用, 和isc-dhcp-server、dnsmasq 两个DHCP服务有关
func InitGenericGroup ¶
func InitGenericGroup(GenericGroup *model.MGenericGroup) error
创建GenericGroup
func InsertGenericGroup ¶
func InsertGenericGroup(GenericGroup *model.MGenericGroup) error
创建GenericGroup
func InsertInternalNotify ¶
func InsertInternalNotify(m model.MInternalNotify) error
* * InsertInternalNotifies *
func InsertMInEnd ¶
func InsertMOutEnd ¶
func InsertMRule ¶
func InsertMUser ¶
func InsertModbusPointPosition ¶
func InsertModbusPointPosition(P model.MModbusDataPoint) error
InsertModbusPointPosition 插入modbus点位表
func InsertModbusPointPositions ¶
func InsertModbusPointPositions(list []model.MModbusDataPoint) error
* * Modbus点位表管理 *
InsertModbusPointPosition 插入modbus点位表
func InsertSiemensPointPosition ¶
func InsertSiemensPointPosition(P model.MSiemensDataPoint) error
InsertSiemensPointPosition 插入Siemens点位表
func InsertSiemensPointPositions ¶
func InsertSiemensPointPositions(list []model.MSiemensDataPoint) error
* * Siemens点位表管理 *
InsertSiemensPointPosition 插入Siemens点位表
func InsertUserLuaTemplate ¶
func InsertUserLuaTemplate(UserLuaTemplate model.MUserLuaTemplate) error
创建UserLuaTemplate
func IpRouteDetail ¶
func ListByGroupType ¶
func ListByGroupType(t string) []model.MGenericGroup
func ReBindResource ¶
* * 重新绑定分组需要事务支持 *
func ReadPageRequest ¶
func ReadPageRequest(c *gin.Context) (*model.PageRequest, error)
func RestartNetworkManager ¶
func RestartNetworkManager() error
RestartNetworkManager 用于重启 NetworkManager 服务
func SearchUserLuaTemplate ¶
func SearchUserLuaTemplate(label, detail string) []model.MUserLuaTemplate
模糊查询 SELECT * FROM m_user_lua_templates WHERE label like "%%" OR detail like "%%"
func TruncateConfig ¶
func TruncateConfig() error
*
- 清空表:DELETE FROM table_name; DELETE FROM sqlite_sequence WHERE name='m_network_configs';
*
func UpdateDefaultRoute ¶
* * 删除原来的垃圾路由,换成最新的配置 *
func UpdateEth0Config ¶
func UpdateEth0Config(MNetworkConfig model.MNetworkConfig) error
* * 永远只更新id=0的 *
func UpdateEth1Config ¶
func UpdateEth1Config(MNetworkConfig model.MNetworkConfig) error
* * 永远只更新id=1的 *
func UpdateGenericGroup ¶
func UpdateGenericGroup(GenericGroup *model.MGenericGroup) error
更新GenericGroup
func UpdateMUser ¶
func UpdateModbusPoint ¶
func UpdateModbusPoint(MModbusDataPoint model.MModbusDataPoint) error
更新DataSchema
func UpdateScheduleTask ¶
func UpdateScheduleTask(data *dto.CronTaskUpdateDTO) (*model.MCronTask, error)
func UpdateSiemensPoint ¶
func UpdateSiemensPoint(MSiemensDataPoint model.MSiemensDataPoint) error
更新DataSchema
func UpdateUserLuaTemplate ¶
func UpdateUserLuaTemplate(UserLuaTemplate model.MUserLuaTemplate) error
更新UserLuaTemplate
func UpdateWlan0Config ¶
func UpdateWlan0Config(MNetworkConfig model.MWifiConfig) error
* * 配置WIFI Wlan0 *
func WrapPageResult ¶
func WrapPageResult(page model.PageRequest, records any, count int64) model.PageResult
Types ¶
type UartConfigDto ¶
type UartConfigDto struct { Timeout int Uart string BaudRate int DataBits int Parity string StopBits int }
func (UartConfigDto) JsonString ¶
func (u UartConfigDto) JsonString() string
Source Files ¶
- crontask_service.go
- dao.go
- data_schema_service.go
- database_manage_service.go
- device_modbus_data_sheet_service.go
- device_s1200_data_import_service.go
- group_service.go
- hw_intrerface_service.go
- internal_notify_service.go
- linux_network_config_service.go
- linux_wlan_config_service.go
- memory_usage_linux.go
- page_service.go
- rhinoh3_ubuntu18_iproute_service.go
- site_config_service.go
- table_count_service.go
- user_lua_template_service.go
- visual_screen_service.go
- windows_eth_config.go