Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/goravel/gin
Gin driver for Goravel
https://github.com/goravel/gin
gin go
Last synced: 2 months ago
JSON representation
Gin driver for Goravel
- Host: GitHub
- URL: https://github.com/goravel/gin
- Owner: goravel
- License: mit
- Created: 2023-06-19T09:17:19.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-09-30T08:35:54.000Z (3 months ago)
- Last Synced: 2024-10-01T01:02:40.904Z (3 months ago)
- Topics: gin, go
- Language: Go
- Homepage:
- Size: 411 KB
- Stars: 7
- Watchers: 3
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Gin
[![Doc](https://pkg.go.dev/badge/github.com/goravel/gin)](https://pkg.go.dev/github.com/goravel/gin)
[![Go](https://img.shields.io/github/go-mod/go-version/goravel/gin)](https://go.dev/)
[![Release](https://img.shields.io/github/release/goravel/gin.svg)](https://github.com/goravel/gin/releases)
[![Test](https://github.com/goravel/gin/actions/workflows/test.yml/badge.svg)](https://github.com/goravel/gin/actions)
[![Report Card](https://goreportcard.com/badge/github.com/goravel/gin)](https://goreportcard.com/report/github.com/goravel/gin)
[![Codecov](https://codecov.io/gh/goravel/gin/branch/master/graph/badge.svg)](https://codecov.io/gh/goravel/gin)
![License](https://img.shields.io/github/license/goravel/gin)Gin http driver for Goravel.
## Version
| goravel/gin | goravel/framework |
|-------------|-------------------|
| v1.2.x | v1.14.x |
| v1.1.x | v1.13.x |## Install
1. Add package
```
go get -u github.com/goravel/gin
```2. Register service provider
```
// config/app.go
import "github.com/goravel/gin""providers": []foundation.ServiceProvider{
...
&gin.ServiceProvider{},
}
```3. 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 ./...
```