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

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

	"agent/cmd/agent/config"
)

// 插件名
const (
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
32
33
	PushStreamingPluginSocket = PushStreamingPlugin + ".sock"
	ReportDCSInfoPluginSocket = ReportDCSInfoPlugin + ".sock"

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

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

type Msg struct {
	PlgName string
	PlgMsg  CommMsg
}

type CommMsg struct {
	MsgType string
}
46
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)
}