Plugin is a common concept for Satellite, which is in all externsion plugins.
The Plugin registration mechanism in Satellite is similar to the SPI registration mechanism of Java. Plugin registration mechanism supports to register an interface and its implementation, that means different interfaces have different registration spaces. We can easily find the type of a specific plugin according to the interface and the plugin name and initialize it according to the type.
structure:
map[reflect.Type]map[string]reflect.Value
map[interface type]map[plugin name] plugin type
Users can easily find a plugin type and initialize an empty plugin instance according to the previous registration mechanism. For setting up the configuration of the extension convenience, we define the initialization mechanism in Plugin structure.
In the initialization mechanism, the plugin category(interface)
and the init config is required
.
Initialize processing is like the following.
plugin_name
.Nowadays, the numbers of the Plugin categories is 2. One is the sharing Plugin, and another is the other normal Plugin.