plugin.go 704 字节
Newer Older
Y
Your Name 已提交
1
package plugin_entity
E
eoLinker API Management 已提交
2

Y
Your Name 已提交
3
//Plugin 插件
E
eoLinker API Management 已提交
4 5 6 7 8 9 10 11 12 13
type Plugin struct {
	PluginID     int    `json:"pluginID"`
	PluginName   string `json:"pluginName"`
	PluginStatus int    `json:"pluginStatus"`
	PluginIndex  int    `json:"pluginPriority"`
	PluginConfig string `json:"pluginConfig"`
	PluginInfo   string `json:"pluginInfo"`
	IsStop       int    `json:"isStop"`
}

Y
Your Name 已提交
14
//PluginSlice 插件切片
E
eoLinker API Management 已提交
15 16 17 18 19 20 21 22 23 24 25
type PluginSlice []*Plugin

func (p PluginSlice) Len() int { // 重写 Len() 方法
	return len(p)
}
func (p PluginSlice) Swap(i, j int) { // 重写 Swap() 方法
	p[i], p[j] = p[j], p[i]
}
func (p PluginSlice) Less(i, j int) bool { // 重写 Less() 方法, 从小到大排序
	return p[i].PluginIndex < p[j].PluginIndex
}