styx/plugins/main.go
Christopher Talib b2da64a9d7 Enh/modular arch
2020-02-25 10:05:31 +01:00

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
}