repositorypackage
0.0.0-20210623130224-29af1e1d2860
Repository: https://github.com/joe2k/playing-with-go.git
Documentation: pkg.go.dev
# README
playing-with-go
A very simple Notification Service in Go with Postgres Database 💬
How to use?
- Clone this repository
git clone https://github.com/Joe2k/playing-with-go
cd playing-with-go
- Create a .env file in the root directory and place all important DB info like below
APP_DB_USERNAME=postgres
APP_DB_PASSWORD="12345"
APP_DB_NAME=postgres
- Start a Postgres server with Docker with the make command below
make postgres
- Run the Go Server
go run main.go
Run Tests
To run unit tests, run the command below
go test -v
API Reference
Get all notifications
GET /notifications
Create a notification
POST /notification
Get a notification
GET /notification/:id
Update a notification
PUT /notification/:id
Parameter | Type | Description |
---|---|---|
id | int | Optional |
number | int | Contact Number |
message | string | Message to be delivered |