Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bygui86/go-rest
REST example project in Golang
https://github.com/bygui86/go-rest
Last synced: 2 days ago
JSON representation
REST example project in Golang
- Host: GitHub
- URL: https://github.com/bygui86/go-rest
- Owner: bygui86
- License: apache-2.0
- Created: 2020-03-22T09:11:41.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-02T18:28:39.000Z (over 4 years ago)
- Last Synced: 2024-11-08T06:07:50.234Z (about 2 months ago)
- Language: Go
- Size: 63.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go REST
Project to explore REST APIs in Golang
---
## TODO list
- [x] simple blog-posts REST APIs for without DB
- [x] testing blog-posts REST APIs
- [x] unit-testing
- [x] integration-testing
- [ ] simple products REST APIs for with DB (PostgreSQL)
- [ ] testing products REST APIs
- [ ] unit-testing
- [ ] integration-testing## Build
```shell
make build
```---
## Test
### Unit-testing
```shell
make unit-test
```### Integration-testing
```shell
make integr-test
```### Functional-testing
`TBD`### Smoke-testing (a.k.a. Build Verification testing)
`TBD`### Contract-testing
`TBD`---
## Run
1. start application
```shell
make run
```2. use [Postman](https://www.postman.com/) to import the [requests collection](./postman) and make some requests
---
## Prometheus metrics
`TODO`
see https://github.com/prometheus/client_golang/blob/master/prometheus/examples_test.go
---
## Links
### REST
- [x] https://medium.com/@hugo.bjarred/rest-api-with-golang-and-mux-e934f581b8b5
- [x] https://golangcode.com/get-a-url-parameter-from-a-request/### PostgreSQL
- [ ] https://semaphoreci.com/community/tutorials/building-and-testing-a-rest-api-in-go-with-gorilla-mux-and-postgresql### Testing frameworks
- [x] https://github.com/stretchr/testify
- [ ] https://onsi.github.io/ginkgo/
- [ ] https://onsi.github.io/gomega/
- [ ] https://github.com/golang/mock
- [ ] https://github.com/vektra/mockery
- [ ] http://labix.org/gocheck### Unit-testing
- [x] https://codeburst.io/unit-testing-for-rest-apis-in-go-86c70dada52d
- [x] https://golang.org/src/net/http/httptest/example_test.go
- [x] https://github.com/gorilla/mux/issues/373#issuecomment-388568971### Integration-testing
- [x] https://stackoverflow.com/questions/42474259/golang-how-to-live-test-an-http-server
- [x] https://polothy.github.io/post/2019-04-13-testing-gorrilla-mux-handlers/
- [ ] https://medium.com/@victorsteven/understanding-unit-and-integrationtesting-in-golang-ba60becb778d
- [ ] https://www.ardanlabs.com/blog/2019/03/integration-testing-in-go-executing-tests-with-docker.html
- [ ] https://www.ardanlabs.com/blog/2019/10/integration-testing-in-go-set-up-and-writing-tests.html
- [ ] https://github.com/testcontainers/testcontainers-go### Smoke-testing (a.k.a. Build Verification testing)
- [ ] https://medium.com/@felipedutratine/smoke-tests-easily-a008e1e67d50
- [ ] https://www.slideshare.net/alexeygolubev10/smoke-testing-with-go### Contract-testing
- [ ] https://www.youtube.com/watch?v=-6x6XBDf9sQ
- [ ] https://pkg.go.dev/github.com/pact-foundation/pact-go?tab=doc
- [ ] https://github.com/pact-foundation/pact-workshop-go### Code coverage
- [ ] https://stackoverflow.com/questions/10516662/how-to-measure-code-coverage-in-golang