mirror of https://gitee.com/answerdev/answer.git
chore(plugin): remove sample
This commit is contained in:
parent
689297e14d
commit
072bf002c2
|
@ -1,20 +0,0 @@
|
|||
package sample
|
||||
|
||||
import "github.com/answerdev/answer/plugin"
|
||||
|
||||
type Connector struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
plugin.Register(&Connector{})
|
||||
}
|
||||
|
||||
func (c *Connector) Info() plugin.Info {
|
||||
return plugin.Info{
|
||||
Name: plugin.MakeTranslator("plugin.connector.name"),
|
||||
SlugName: "connector",
|
||||
//Description: plugin.MakeTranslator("plugin.connector.description"),
|
||||
Author: "answerdev",
|
||||
Version: "0.0.1",
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package sample
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/answerdev/answer/plugin"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func TestConnector_Info(t *testing.T) {
|
||||
c, _ := gin.CreateTestContext(httptest.NewRecorder())
|
||||
c.Request, _ = http.NewRequest("", "", nil)
|
||||
c.Request.Header.Set("Accept-Language", "en_US")
|
||||
_ = plugin.CallBase(func(base plugin.Base) error {
|
||||
info := base.Info()
|
||||
fmt.Println(info.Name.Translate(c))
|
||||
fmt.Println(info.SlugName)
|
||||
fmt.Println(info.Description.Translate(c))
|
||||
fmt.Println(info.Author)
|
||||
fmt.Println(info.Version)
|
||||
return nil
|
||||
})
|
||||
}
|
Loading…
Reference in New Issue