Documentation

Index

Examples

Constants

View Source
const REGISTRABLE_VAR = "Registrable"

    REGISTRABLE_VAR is the name to lookup after loading the plugin for the module registering

    Variables

    This section is empty.

    Functions

    func Load

    func Load(cfg config.Plugin, reg *Register) (int, error)

      Load loads all the plugins in pluginFolder with pattern in its filename. It returns the number of plugins loaded and an error if something goes wrong.

      func Scan

      func Scan(folder, pattern string) ([]string, error)

      Types

      type Plugin

      type Plugin interface {
      	Lookup(name string) (plugin.Symbol, error)
      }

        Plugin is the interface of the loaded plugins

        type Register

        type Register struct {
        	Decoder  *encoding.DecoderRegister
        	SD       *sd.Register
        	External *register.Namespaced
        }

          Register contains all the registers required by the framework and the external modules

          func NewRegister

          func NewRegister() *Register

            NewRegister returns a new register to be used by the plugin loader

            func (*Register) Register

            func (r *Register) Register(p Plugin) error

              Register registers the received plugin in the proper internal registers

              Example (Ok)
              Output:
              
              registrable 1 from plugin samplePluginName is registering its decoder components
              registrable 1 from plugin samplePluginName is registering its components depending on external modules
              
              Example (UnknownInterface)
              Output:
              
              unknown registrable interface
              

              type RegistrableDecoder

              type RegistrableDecoder interface {
              	RegisterDecoder(func(name string, dec func(bool) func(io.Reader, *map[string]interface{}) error) error) error
              }

                RegistrableDecoder defines the interface the encoding plugins should implement in order to be able to register themselves

                type RegistrableExternal

                type RegistrableExternal interface {
                	RegisterExternal(func(namespace, name string, v interface{})) error
                }

                  RegistrableExternal defines the interface the external plugins should implement in order to be able to register themselves

                  Directories

                  Path Synopsis
                  tests
                  app