Skip to content

Commit

Permalink
feat: Software Watchdog Template
Browse files Browse the repository at this point in the history
  • Loading branch information
wwhai committed Sep 15, 2023
1 parent d6e8790 commit 29905e3
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
69 changes: 69 additions & 0 deletions plugin/soft_watchdog/soft_watchdog.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// 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/>.

package softwatchdog

import (
"github.com/hootrhino/rulex/typex"
"gopkg.in/ini.v1"
)

/*
*
* 软件看门狗
*
*/
type softWatchDog struct {
uuid string
}

func NewSoftWatchDog() *softWatchDog {
return &softWatchDog{
uuid: "SOFT_WATCHDOG",
}
}

func (dog *softWatchDog) Init(config *ini.Section) error {
return nil
}

func (dog *softWatchDog) Start(typex.RuleX) error {
return nil
}
func (dog *softWatchDog) Stop() error {
return nil
}

func (hh *softWatchDog) PluginMetaInfo() typex.XPluginMetaInfo {
return typex.XPluginMetaInfo{
UUID: hh.uuid,
Name: "Soft WatchDog",
Version: "v0.0.1",
Homepage: "https://hootrhino.github.io",
HelpLink: "https://hootrhino.github.io",
Author: "wwhai",
Email: "cnwwhai@gmail.com",
License: "MIT",
}
}

/*
*
* 服务调用接口
*
*/
func (cs *softWatchDog) Service(arg typex.ServiceArg) typex.ServiceResult {
return typex.ServiceResult{}
}
19 changes: 19 additions & 0 deletions plugin/soft_watchdog/soft_watchdog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!--
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/>.
-->

# 软件看门狗
软件看门狗(Software Watchdog)用于监视应用程序或系统的运行状态,并在检测到问题时采取预定的操作。这有助于确保系统或应用程序在异常情况下能够自动恢复或采取适当的措施,以防止系统崩溃或无响应。

0 comments on commit 29905e3

Please sign in to comment.