Skip to content

Abdulsametileri/messaging-service-go

Repository files navigation

TO DO LIST

  • Users can create account and login
  • The only way the user can message have to know the receiver user name.
  • Users can access their chat history.
  • Users can block each other
  • All errors must be stored and dont send critical error messages on client side
  • Dockerize and scalability
  • Unit Test Coverage

API Endpoints

POST api/v1/register

POST api/v1/login

JWT Middleware

In order to request as you predict, you have to put token.

Authorization: Bearer eydsad.....

GET api/v1/mutateUser/:mutateUserId

GET api/v1/users

GET api/v1/messagesWith/:userName

POST api/v1/sendMessage/:userName

Build and up with docker-compose

$ docker-compose up --build

Build development mode

$ go run --tags dev main.go

Example Request URL's

You must add :8080 if you are development mode.

http://localhost/api/v1/register

http://localhost/api/v1/sendMessage/abdulsamet

http://localhost/api/v1/mutateUser/3

As default application runs 3 instance. You can easly edit docker-compose.yml

api:
    ....
    deploy:
      replicas: 3
    ...

To see unit tests and their coverage, run

$ go test --tags dev --cover ./...

Releases

No releases published

Packages

No packages published

Languages