Documentation ¶
Index ¶
- Variables
- func DiscoverPlugins(dirs []string) ([]string, error)
- func Factory(ctx context.Context, path string, interfaces []string) (*plugin.Client, error)
- func FindPlugins(dirs []string) ([]string, error)
- func Interfaces(ctx context.Context, path string) ([]string, error)
- func ResolvePlugins(dirs []string) (map[string]string, error)
- type Manager
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPluginNotFound = errors.New("plugin not found")
ErrPluginNotFound is returned when a plugin is not found.
View Source
var ErrUnexpectedInterface = errors.New("unexpected interface")
ErrUnexpectedInterface is returned when the plugin does not support the expected interface.
View Source
var ErrUnsupportedPluginInterface = fmt.Errorf("unsupported plugin interface")
ErrUnsupportedPluginInterface is returned when an interface is requested that is not supported.
Functions ¶
func DiscoverPlugins ¶
DiscoverPlugins looks for available plugins in the provided directories.
func FindPlugins ¶
FindPlugins looks for available plugins in the same directory as the exeuatable or in the provided directories.
func Interfaces ¶
Intrerfaces discovers the interfaces supported by the plugin.
Types ¶
type Manager ¶
type Manager struct { Clients map[string]*plugin.Client Dirs []string // contains filtered or unexported fields }
func NewManager ¶
func (*Manager) Interfaces ¶
Interfaces returns a list of interfaces for a given plugin.
Click to show internal directories.
Click to hide internal directories.