plugin.go 272 B

12345678910111213141516
  1. package example
  2. import "github.com/gin-gonic/gin"
  3. type Plugin struct {
  4. }
  5. func (*Plugin) Register(group *gin.RouterGroup) {
  6. group.GET("hello", func(context *gin.Context) {
  7. context.JSON(200, "hello world")
  8. })
  9. }
  10. func (*Plugin) RouterPath() string {
  11. return "group"
  12. }