plugins

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: BSD-3-Clause Imports: 2 Imported by: 0

README

Go plugins manager

Build Status Coverage Status Go.Dev reference Go Report Card Release

The plugins is a simple Go plugins manager.

Installation

$ go get -u clevergo.tech/plugins

Usage

// Plugins location.
path := "/path/to/plugins"
// Creates a plugins manager.
m := plugins.New(path)

// Opens a Go plugins which located at {path}/foo.so
p, err := m.Open("foo.so")

// Lookup a symbol in a plugin.
sym, err := m.Lookup("foo.so", "Bar")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// The location of plugins.
	Path string
}

Manager is a manager that manage plugins.

func New

func New(path string) *Manager

New returns a plugins manager with the given path.

func (*Manager) Lookup

func (pm *Manager) Lookup(pluginName, symName string) (plugin.Symbol, error)

Lookup searches for a symbol named symName in a plugin named pluginName.

func (*Manager) Open

func (pm *Manager) Open(name string) (*plugin.Plugin, error)

Open opens a Go plugin.

Jump to

Keyboard shortcuts

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