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")
Expand ▾ Collapse ▴

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.

          Source Files