config.go 1.2 KB
Newer Older
Lei Li's avatar
Lei Li committed
1
2
3
package plugin

import (
4
	"path/filepath"
Lei Li's avatar
Lei Li committed
5
6
7
8
9
10
11
	"time"

	"agent/cmd/agent/config"
)

// 插件名
const (
Lei Li's avatar
Lei Li committed
12
	AgentSelfPlugin     = "agent"
13
14
	PushStreamingPlugin = "pushStreaming"
	ReportDCSInfoPlugin = "reportDCSInfo"
Lei Li's avatar
Lei Li committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
)

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

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

var (
29
30
31
	PushStreamingPluginSocket = PushStreamingPlugin + ".sock"
	ReportDCSInfoPluginSocket = ReportDCSInfoPlugin + ".sock"

32
33
34
	PushStreamingPluginBinFile = ""
	ReportDCSInfoPluginBinFile = ""

35
36
	defaultPluginMgrConfFile = "plugin.conf"
	DefaultCallTimeout       = 5 * time.Second
Lei Li's avatar
Lei Li committed
37
38
39
40
41
42
43
44
45
46
)

type Msg struct {
	PlgName string
	PlgMsg  CommMsg
}

type CommMsg struct {
	MsgType string
}
47
48
49
50
51

func setPluginSocketPath() {
	PushStreamingPluginSocket = filepath.Join(config.PluginDir, PushStreamingPluginSocket)
	ReportDCSInfoPluginSocket = filepath.Join(config.PluginDir, ReportDCSInfoPluginSocket)
	defaultPluginMgrConfFile = filepath.Join(config.PluginDir, defaultPluginMgrConfFile)
52
53
	PushStreamingPluginBinFile = filepath.Join(config.PluginDir, PushStreamingPlugin)
	ReportDCSInfoPluginBinFile = filepath.Join(config.PluginDir, ReportDCSInfoPlugin)
54
}