修复go plugin相关错误 (#964)

Co-authored-by: tanxiao <tanxiao@asiainfo.com>
This commit is contained in:
xtan 2022-05-27 17:38:15 +08:00 committed by GitHub
parent c040dffb5f
commit 070e5051c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 9 deletions

View File

@ -29,7 +29,7 @@ type inter interface {
[Alerting.CallPlugin] [Alerting.CallPlugin]
Enable = false Enable = false
PluginPath = "./etc/script/notify.so" PluginPath = "./etc/script/notify.so"
# 注意此处caller必须在notify.so中作为变量暴露 # 注意此处caller必须在notify.so中作为变量暴露,首字母必须大写才能暴露
Caller = "n9eCaller" Caller = "N9eCaller"
``` ```

View File

@ -37,8 +37,8 @@ func (n *N9EPlugin) Notify(bs []byte) {
} }
} }
// will be loaded for alertingCall // will be loaded for alertingCall , The first letter must be capitalized to be exported
var n9eCaller = N9EPlugin{ var N9eCaller = N9EPlugin{
Name: "n9e", Name: "n9e",
Description: "演示告警通过动态链接库方式通知", Description: "演示告警通过动态链接库方式通知",
BuildAt: time.Now().Local().Format("2006/01/02 15:04:05"), BuildAt: time.Now().Local().Format("2006/01/02 15:04:05"),

View File

@ -29,7 +29,7 @@ type inter interface {
[Alerting.CallPlugin] [Alerting.CallPlugin]
Enable = false Enable = false
PluginPath = "./etc/script/notify.so" PluginPath = "./etc/script/notify.so"
# 注意此处caller必须在notify.so中作为变量暴露 # 注意此处caller必须在notify.so中作为变量暴露,首字母必须大写才能暴露
Caller = "n9eCaller" Caller = "N9eCaller"
``` ```

View File

@ -37,8 +37,8 @@ func (n *N9EPlugin) Notify(bs []byte) {
} }
} }
// will be loaded for alertingCall // will be loaded for alertingCall , The first letter must be capitalized to be exported
var n9eCaller = N9EPlugin{ var N9eCaller = N9EPlugin{
Name: "n9e", Name: "n9e",
Description: "演示告警通过动态链接库方式通知", Description: "演示告警通过动态链接库方式通知",
BuildAt: time.Now().Local().Format("2006/01/02 15:04:05"), BuildAt: time.Now().Local().Format("2006/01/02 15:04:05"),

View File

@ -85,7 +85,8 @@ ScriptPath = "./etc/script/notify.py"
Enable = false Enable = false
# use a plugin via `go build -buildmode=plugin -o notify.so` # use a plugin via `go build -buildmode=plugin -o notify.so`
PluginPath = "./etc/script/notify.so" PluginPath = "./etc/script/notify.so"
Caller = "n9eCaller" # The first letter must be capitalized to be exported
Caller = "N9eCaller"
[Alerting.RedisPub] [Alerting.RedisPub]
Enable = false Enable = false