go-micro: github.com/micro/go-micro/plugin Index | Files

package plugin

import "github.com/micro/go-micro/plugin"

Package plugin provides the ability to load plugins

Package plugin provides the ability to load plugins


Package Files

default.go plugin.go template.go


var (
    // Default plugin loader
    DefaultPlugin = NewPlugin()

func Build Uses

func Build(path string, c *Config) error

func Init Uses

func Init(c *Config) error

type Config Uses

type Config struct {
    // Name of the plugin e.g rabbitmq
    Name string
    // Type of the plugin e.g broker
    Type string
    // Path specifies the import path
    Path string
    // NewFunc creates an instance of the plugin
    NewFunc interface{}

Config is the plugin config

func Load Uses

func Load(path string) (*Config, error)

type Plugin Uses

type Plugin interface {
    // Initialise a plugin with the config
    Init(c *Config) error
    // Load loads a .so plugin at the given path
    Load(path string) (*Config, error)
    // Build a .so plugin with config at the path specified
    Build(path string, c *Config) error

Plugin is a plugin loaded from a file

func NewPlugin Uses

func NewPlugin() Plugin

NewPlugin creates a new plugin interface

Package plugin imports 15 packages (graph) and is imported by 6 packages. Updated 2020-02-22. Refresh now. Tools for package owners.