refactor(blogo,plugin): move plugin definitions to their own file
This commit is contained in:
@@ -13,9 +13,15 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package blogo
|
||||
package plugin
|
||||
|
||||
const pluginGroupPluginName = "blogo-plugingroup-group"
|
||||
const pluginGroupName = "blogo-plugingroup-group"
|
||||
|
||||
type PluginGroup interface {
|
||||
Plugin
|
||||
WithPlugins
|
||||
Plugins() []Plugin
|
||||
}
|
||||
|
||||
type pluginGroup struct {
|
||||
plugins []Plugin
|
||||
@@ -26,7 +32,7 @@ func NewPluginGroup(plugins ...Plugin) PluginGroup {
|
||||
}
|
||||
|
||||
func (p *pluginGroup) Name() string {
|
||||
return pluginGroupPluginName
|
||||
return pluginGroupName
|
||||
}
|
||||
|
||||
func (p *pluginGroup) Use(plugin Plugin) {
|
||||
@@ -13,33 +13,29 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package blogo
|
||||
package plugin
|
||||
|
||||
import (
|
||||
"io"
|
||||
|
||||
"forge.capytal.company/loreddev/x/blogo/fs"
|
||||
)
|
||||
|
||||
type Plugin interface {
|
||||
Name() string
|
||||
}
|
||||
|
||||
type PluginWithPlugins interface {
|
||||
type WithPlugins interface {
|
||||
Plugin
|
||||
Use(Plugin)
|
||||
}
|
||||
|
||||
type PluginGroup interface {
|
||||
type Renderer interface {
|
||||
Plugin
|
||||
PluginWithPlugins
|
||||
Plugins() []Plugin
|
||||
Render(src fs.File, out io.Writer) error
|
||||
}
|
||||
|
||||
type RendererPlugin interface {
|
||||
type Sourcer interface {
|
||||
Plugin
|
||||
Render(src File, out io.Writer) error
|
||||
}
|
||||
|
||||
type SourcerPlugin interface {
|
||||
Plugin
|
||||
Source() (FS, error)
|
||||
Source() (fs.FS, error)
|
||||
}
|
||||
Reference in New Issue
Block a user