plugin_manager

package
v0.14.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusDisable = "disable"
	StatusEnable  = "enable"
	StatusGlobal  = "global"
)

Variables

View Source
var (
	ErrorDriverNotExit             = errors.New("drive not exit")
	ErrorGlobalPluginMastConfig    = errors.New("global must have config")
	ErrorGlobalPluginConfigInvalid = errors.New("invalid global config")
)

Functions

func Register

func Register(register eosc.IExtenderDriverRegister)

Types

type Plugin

type Plugin struct {
	*PluginConfig
	// contains filtered or unexported fields
}

type PluginConfig

type PluginConfig struct {
	Name       string                 `json:"name" yaml:"name" `
	ID         string                 `json:"id" yaml:"id"`
	Status     string                 `json:"status" yaml:"status"`
	Config     interface{}            `json:"config" yaml:"config"`
	InitConfig map[string]interface{} `json:"init_config" yaml:"init_config"`
}

PluginConfig 全局插件配置

func (*PluginConfig) GetType

func (p *PluginConfig) GetType(originVal reflect.Value) (reflect.Type, error)

func (*PluginConfig) Reset

func (p *PluginConfig) Reset(originVal reflect.Value, targetVal reflect.Value, variables eosc.IVariable) ([]string, error)

type PluginManager

type PluginManager struct {
	// contains filtered or unexported fields
}

func NewPluginManager

func NewPluginManager() *PluginManager

func (*PluginManager) AllWorkers

func (p *PluginManager) AllWorkers() []string

func (*PluginManager) Check

func (p *PluginManager) Check(cfg interface{}) (profession, name, driver, desc string, err error)

func (*PluginManager) ConfigType

func (p *PluginManager) ConfigType() reflect.Type

func (*PluginManager) CreateRequest

func (p *PluginManager) CreateRequest(id string, conf map[string]*plugin.Config) eocontext.IChainPro

func (*PluginManager) Get

func (p *PluginManager) Get() interface{}

func (*PluginManager) GetConfigType

func (p *PluginManager) GetConfigType(name string) (reflect.Type, bool)

func (*PluginManager) Global added in v0.10.0

func (p *PluginManager) Global() eocontext.IChainPro

func (*PluginManager) IsExists

func (p *PluginManager) IsExists(id string) bool

func (*PluginManager) Mode

func (p *PluginManager) Mode() eosc.SettingMode

func (*PluginManager) Reset

func (p *PluginManager) Reset(conf interface{}) error

func (*PluginManager) Set

func (p *PluginManager) Set(conf interface{}) (err error)

type PluginObj

type PluginObj struct {
	// contains filtered or unexported fields
}

func NewPluginObj

func NewPluginObj(filters eoscContext.Filters, id string, conf map[string]*plugin.Config) *PluginObj

func (*PluginObj) Chain

func (p *PluginObj) Chain(ctx eoscContext.EoContext, append ...eoscContext.IFilter) error

func (*PluginObj) Destroy

func (p *PluginObj) Destroy()

type PluginWorkerConfig

type PluginWorkerConfig struct {
	Plugins []*PluginConfig `json:"plugins" yaml:"plugins"`
}

type Plugins

type Plugins []*Plugin

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL