mirror of
https://github.com/eolinker/apinto
synced 2025-10-05 08:47:04 +08:00
30 lines
632 B
Go
30 lines
632 B
Go
package plugin_manager
|
|
|
|
import (
|
|
"github.com/eolinker/apinto/plugin"
|
|
eoscContext "github.com/eolinker/eosc/eocontext"
|
|
)
|
|
|
|
type PluginObj struct {
|
|
fs eoscContext.Filters
|
|
id string
|
|
conf map[string]*plugin.Config
|
|
}
|
|
|
|
func NewPluginObj(filters eoscContext.Filters, id string, conf map[string]*plugin.Config) *PluginObj {
|
|
obj := &PluginObj{fs: filters, id: id, conf: conf}
|
|
|
|
return obj
|
|
}
|
|
|
|
func (p *PluginObj) Chain(ctx eoscContext.EoContext, append ...eoscContext.IFilter) error {
|
|
return eoscContext.DoChain(ctx, p.fs, append...)
|
|
}
|
|
func (p *PluginObj) Destroy() {
|
|
|
|
handler := p.fs
|
|
if handler != nil {
|
|
handler.Destroy()
|
|
}
|
|
}
|