modulepackage
0.0.0-20200118162751-fbc138b259c5
Repository: https://github.com/5anthosh/mint.git
Documentation: pkg.go.dev
# README
🌿 Mint web framework

it is simple lightweight web framework, it helps to keep the core simple but extensible. Mint uses gorilla mux router. Mint does not include a database abstraction layer or body validation or anything else
Installation
To use Mint package, you need to install Go first in your system and set its workspace
$ go get -u github.com/5anthosh/mint
A Simple Example
In example.go file
package main
import "github.com/5anthosh/mint"
func main() {
r := mint.New()
r.GET("/{message}", func(c *mint.Context) {
c.JSON(200, mint.JSON{
"message": c.DefaultParam("message", "Hello World !"),
})
})
r.Run(":8080")
}
To run the program
$ go run example.go
Example
# Functions
ErrorMessage #.
From registers router to mt.
HandlerBuilder new handerContext.
New creates new application.
NewBufferPool #.
NewGroup creates new handlers Group.
NewLogger creates a new logger.
NewRouter creates new router for application.
Simple creates new application without any defualt handlers.
URLVar formats url var.
# Constants
constant.
# Variables
DefaultHandlerWithLogger middlewares including logger.
# Structs
BufferPool #.
Context provides context for whole request/response cycleIt helps to pass variable from one middlware to another.
HandlerContext #.
HandlersGroup #.
Logger logger structure.
Mint is framework's instance, it contains default middleware, DB, handlers configurationCreate Intance of Mint using New() method.
# Type aliases
HandlerFunc handles requests for an URL.
Handlers chain of Handler.
JSON basic json type.