config.go 685 Bytes
Newer Older
Lei Li's avatar
Lei Li committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package plugin

import (
	"errors"
	"time"

	"agent/cmd/agent/config"
)

// 插件名
const (
	HadesPlugin    = "agent"
	DobermanPlugin = "doberman"
)

// 插件函数
const (
	ProcessPluginMsg = "processPluginMsg"
)

// 插件消息
const (
	PluginOpenDebugMsg  = "pluginOpenDebugMsg"
	PluginCloseDebugMsg = "pluginCloseDebugMsg"
)

var (
	HadesPluginSocket    = config.PluginDir + "/" + HadesPlugin + ".sock"
	DobermanPluginSocket = config.PluginDir + "/" + DobermanPlugin + ".sock"
	DefaultCallTimeout   = 5 * time.Second

	ErrDisconnected = errors.New("doberman plugin disconnected")
)

type Msg struct {
	PlgName string
	PlgMsg  CommMsg
}

type CommMsg struct {
	MsgType string
}