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 ¶
Types ¶
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 ¶
Register registers the received plugin in the propper internal registers
Example (Ok) ¶
reg := NewRegister() p := dummyPlugin{ content: plugin.Symbol(registrableDummy(1)), } if err := reg.Register(p); err != nil { fmt.Println(err.Error()) }
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) ¶
reg := NewRegister() p := dummyPlugin{ content: plugin.Symbol(1), } if err := reg.Register(p); err != nil { fmt.Println(err.Error()) }
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
Click to show internal directories.
Click to hide internal directories.