Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danteay/ginrest
https://github.com/danteay/ginrest
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/danteay/ginrest
- Owner: danteay
- License: apache-2.0
- Created: 2018-06-29T22:06:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-21T21:03:05.000Z (about 5 years ago)
- Last Synced: 2024-05-01T16:24:08.532Z (8 months ago)
- Language: Go
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ginrest
This is a wrapper librari for gin-gonic rest response
## Use
```go
u := c.Request.RequestURI
r := rest.New(u, "").SetGin(c)
v1 := Record{
Title: "Hola",
Object: "object.overrided",
}
v2 := Extra{
Type: "an Extra",
}
components := rest.Payload{
"object": "override this",
"hola": v1,
"mundo": v2,
}
// println(components)
r.Res(429, components, "")
```