plugin

package
v0.0.0-...-a16fe4d Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyLoad = errors.New("already load")
View Source
var ErrPlgNotExists = errors.New("plugin not exists")
View Source
var PluginManager = NewManager()

Functions

func Startup

func Startup(ctx context.Context, wg *sync.WaitGroup)

Types

type Manager

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

func NewManager

func NewManager() *Manager

func (*Manager) Get

func (pm *Manager) Get(name string) (SDK.IServer, bool)

Get plugin's server side interface

func (*Manager) GetAll

func (pm *Manager) GetAll() (plgs []SDK.IServer)

GetAll returns all plugin interfaces

func (*Manager) Load

func (m *Manager) Load(ctx context.Context, cfg proto.Config) (err error)

Load plugin from proto.Config which has already checked in Download and CheckSignature function, the real plugin and server has already packaged into SDK

Jump to

Keyboard shortcuts

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