24 lines
505 B
Go
24 lines
505 B
Go
|
package plugins
|
||
|
|
||
|
var StyxPlugins = []StyxPlugin{}
|
||
|
|
||
|
// StyxPlugin defines the general plugin architecture.
|
||
|
type StyxPlugin interface {
|
||
|
Initialize()
|
||
|
Run()
|
||
|
Stop()
|
||
|
Check()
|
||
|
}
|
||
|
|
||
|
// RegisterStyxPlugin makes an enrichment plugin available for usage
|
||
|
func RegisterStyxPlugin(p StyxPlugin) {
|
||
|
StyxPlugins = append(StyxPlugins, p)
|
||
|
}
|
||
|
|
||
|
// Worker is a generic set of fields to support graceful start/stop of a concurrent service.
|
||
|
type Worker struct {
|
||
|
StopChan chan bool
|
||
|
StoppedChan chan bool
|
||
|
Running bool
|
||
|
}
|