ginex

module
v0.0.0-...-11dab85 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2022 License: MIT

README

ginex

Some extensions have been made based on GIN

  • Automatic route registration
  • The encapsulation of the return value

GetStart

go get github.com/Merry74751/ginex

Example

import (
	"github.com/Merry74751/ginex/router"
	"github.com/gin-gonic/gin"
	"testing"
)

type UserApi struct {}

func (UserApi) GetById() (string, string, router.Handle) {
	return "GET", "getById", func(c *gin.Context) (any, error) {
		s := "hello world"
		return s, nil
	}
}

func main() {
	app := gin.Default()
	router.addRouter(UserApi{})
	router.RegisterRouter(app)
	
	app.Run()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL