This is an automated email from the ASF dual-hosted git repository.

kumfo pushed a commit to branch feat/1.3.5/embed
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git

commit 61f2e672bc65611acc996b94f29e7717a7a13e05
Author: kumfo <[email protected]>
AuthorDate: Tue May 21 10:55:16 2024 +0800

    feat(embed): init embed
---
 cmd/answer/main.go |  1 +
 docs/docs.go       |  3 +--
 plugin/embed.go    | 11 +++++++++++
 plugin/plugin.go   |  4 ++++
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/cmd/answer/main.go b/cmd/answer/main.go
index ae114709..f8e88bae 100644
--- a/cmd/answer/main.go
+++ b/cmd/answer/main.go
@@ -20,6 +20,7 @@
 package main
 
 import (
+       _ "github.com/apache/incubator-answer-plugins/reviewer-basic"
        answercmd "github.com/apache/incubator-answer/cmd"
 )
 
diff --git a/docs/docs.go b/docs/docs.go
index 30a8e1bc..1c463c12 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -1,5 +1,4 @@
-// Code generated by swaggo/swag. DO NOT EDIT.
-
+// Package docs Code generated by swaggo/swag. DO NOT EDIT
 package docs
 
 import "github.com/swaggo/swag"
diff --git a/plugin/embed.go b/plugin/embed.go
new file mode 100644
index 00000000..a03ab14d
--- /dev/null
+++ b/plugin/embed.go
@@ -0,0 +1,11 @@
+package plugin
+
+type Embed interface {
+       Base
+}
+
+var (
+       // CallReviewer is a function that calls all registered parsers
+       CallEmbed,
+       registerEmbed = MakePlugin[Embed](false)
+)
diff --git a/plugin/plugin.go b/plugin/plugin.go
index e492fdc4..6aade8ee 100644
--- a/plugin/plugin.go
+++ b/plugin/plugin.go
@@ -93,6 +93,10 @@ func Register(p Base) {
        if _, ok := p.(Reviewer); ok {
                registerReviewer(p.(Reviewer))
        }
+
+       if _, ok := p.(Embed); ok {
+               registerEmbed(p.(Embed))
+       }
 }
 
 type Stack[T Base] struct {

Reply via email to