Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bygui86/go-postgres
Go REST PostgreSQL sample project
https://github.com/bygui86/go-postgres
Last synced: 2 days ago
JSON representation
Go REST PostgreSQL sample project
- Host: GitHub
- URL: https://github.com/bygui86/go-postgres
- Owner: bygui86
- License: apache-2.0
- Created: 2019-06-25T19:46:08.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-29T12:10:39.000Z (almost 5 years ago)
- Last Synced: 2024-11-08T06:07:50.174Z (about 2 months ago)
- Language: Go
- Size: 24.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go postgres
Example project to test PostgreSQL integration in Go
## Build
```shell script
make build
```---
## Test
```shell script
make test
```---
## Run
1. start PostgreSQL in a container
```shell script
make run-postgres
```2. run application
```shell script
make run
```3. play a bit with [Postman](https://www.postman.com/) loading the [prepared collection](postman/postman_collection.json)
---
## REST endpoints
- `GET /products` > Fetch a list of products in response to a valid
- `GET /products/{id}` > Fetch a product in response to a valid
- `POST /products` > Create a new product in response to a valid
- `PUT /products/{id}` > Update a product in response to a valid
- `DELETE /products/{id}` > Delete a product in response to a valid---
## Links
- https://semaphoreci.com/community/tutorials/building-and-testing-a-rest-api-in-go-with-gorilla-mux-and-postgresql
- https://errorsingo.com/github.com-lib-pq-err-ssl-not-supported/
- https://medium.com/goingogo/why-use-testmain-for-testing-in-go-dafb52b406bc