Skip to content

bdxing/gineat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gineat

This is a toolkit that enables the GIN framework to support automatic routing.

Installation

To install this package, you need to setup your Go workspace. The simplest way to install the library is to run:

go get github.com/bdxing/gineat

Example

package main

import (
	"github.com/bdxing/gineat"
	"github.com/gin-gonic/gin"
)

type Controller struct {
	*gineat.Context
}

func (obj *Controller) Action() {
	obj.Ctx.JSON(200, gin.H{
		"message": "hello word",
	})
}

func main() {
	r := gineat.Eat(gin.Default())

	r.Auto(&Controller{})

	r.Run("0.0.0.0:8888")

	// request url: http://localhost:8888/controller/action
}

About

Gin framework auto router.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages