Skip to content

cytown/gintool

Repository files navigation

GinTool - Gin Web Framework Config Tool

Gin is a web framework written in Go (Golang) with good performance. GinTool target to make Gin config and start much easier.

Installation

To install GinTool package, you need to install Go and set your Go workspace first.

  1. The first need Go installed (version 1.11+ is required), then you can use the below Go command to install GinTool.
$ go get -u github.com/cytown/gintool
  1. Import it in your code:
import "github.com/cytown/gintool"
  1. Test the GinTool
$ go test
  1. Start the example
$ go run example/example.go

Quick start

package main

import (
	"fmt"

	"github.com/gin-gonic/gin"
	"github.com/cytown/gintool"
)

func main() {
	ge, err := gintool.NewGin("testdata/gin.conf")
	if err != nil {
		fmt.Println("error: ", err)
		return
	}
	ge.Engine.GET("/", func(c *gin.Context) {
		c.JSON(200, gin.H{"hello": "world"})
	})
	err = ge.Start()
}

About

GinTool is a tool for easy develop with Gin

Resources

License

Stars

Watchers

Forks

Packages

No packages published