Skip to content

goravel/gin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8266de7 · Apr 9, 2025
Oct 1, 2024
Aug 30, 2023
Dec 27, 2024
Dec 20, 2024
Jun 30, 2023
Dec 31, 2024
Dec 15, 2024
Feb 28, 2025
Feb 28, 2025
Dec 29, 2024
Dec 29, 2024
Dec 15, 2024
Feb 28, 2025
Feb 28, 2025
Aug 30, 2023
Dec 31, 2024
Jul 3, 2024
Dec 31, 2024
Oct 28, 2024
Dec 31, 2024
Dec 31, 2024
Dec 31, 2024
Oct 28, 2024
Apr 9, 2025
Dec 29, 2024
Jan 1, 2025
Feb 28, 2025
Dec 27, 2024
Aug 9, 2024
Nov 23, 2023
Aug 28, 2023
Jun 29, 2024
Jun 30, 2023
Jun 30, 2023
Nov 30, 2024
Jun 30, 2023
Dec 27, 2024
Nov 23, 2023

Repository files navigation

Gin

Doc Go Release Test Report Card Codecov License

Gin http driver for Goravel.

Version

goravel/gin goravel/framework
v1.3.x v1.15.x
v1.2.x v1.14.x
v1.1.x v1.13.x

Install

  1. Add package
go get -u github.com/goravel/gin
  1. Register service provider
// config/app.go
import "github.com/goravel/gin"

"providers": []foundation.ServiceProvider{
    ...
    &gin.ServiceProvider{},
}
  1. Add gin config to config/http.go file
// config/http.go
import (
    ginfacades "github.com/goravel/gin/facades"
    "github.com/gin-gonic/gin/render"
    "github.com/goravel/gin"
)

"default": "gin",

"drivers": map[string]any{
    "gin": map[string]any{
        // Optional, default is 4096 KB
        "body_limit": 4096,
        "header_limit": 4096,
        "route": func() (route.Route, error) {
            return ginfacades.Route(), nil
        },
        // Optional, default is http/template
        "template": func() (render.HTMLRender, error) {
            return gin.DefaultTemplate()
        },
    },
},

Testing

Run command below to run test:

go test ./...