Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stevenferrer/chi-rest
simple rest api using go-chi
https://github.com/stevenferrer/chi-rest
go go-chi rest-api
Last synced: about 2 months ago
JSON representation
simple rest api using go-chi
- Host: GitHub
- URL: https://github.com/stevenferrer/chi-rest
- Owner: stevenferrer
- License: mit
- Created: 2018-04-24T06:13:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-11-04T03:12:07.000Z (about 3 years ago)
- Last Synced: 2024-06-19T05:59:47.789Z (6 months ago)
- Topics: go, go-chi, rest-api
- Language: Go
- Homepage:
- Size: 47.9 KB
- Stars: 11
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Chi-rest
Boilerplate for REST service using go-chi. This project uses the concept of database agnostic user models by implementing storer interface for the model.
## TODO
* improve errors in validation## Dependencies
* github.com/oxequa/realize
* github.com/go-chi/chi/v5
* github.com/go-chi/render
* github.com/go-chi/middleware
* github.com/go-chi/jwtauth
* github.com/sirupsen/logrus
* github.com/unrolled/render
* github.com/josharian/impl - interface implementation generator
* github.com/jinzhu/gorm - ORM
* github.com/go-gormigrate/gormigrate - database migration
* github.com/go-ozzo/ozzo-validation - struct validation. why this and not other validation package that use struct tags? i really like the concept of this validation package. it doesn't use struct tags and that's what makes it (IMO) superior to others!## Running
`go get` all dependencies before anything else then run:
$ realize start## Tools that might be needed for convenience
* Model generator for a given database
* Response and Request management package
* Stub generator for resources
* Storer interface implemetation generators - impl
* Store implementation tests stub generator
* Database migration - gormigrate (inside store implementations)
* ORM - gorm
### Generating Storer interface stub
Below is an example of generating Storer interface sub.$ impl "s *Store" github.com/stevenferrer/chi-rest/model/user.Storer >> ./store/user/mssql/mssql.go