patriciabonaldy / answer-events-store

API to store, update or get events

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Golang Answer events store microservice πŸ‘‹. Codacy Badge

This application handlers the different states that can have a set of answers for user.

Here, we can use different options to manage the event state can have a group of answers. *

  • Note: We have used package-oriented-design to create this API, you can know more about this link

The requirements of this project have the following:

  1. If a user saves the same key multiple times (using update), it should save every answer. When retrieving an answer, it should return the latest answer.

  2. If a user tries to create an answer that already exists - the request should fail and an adequate message or code should be returned.

  3. If an answer doesn't exist or has been deleted, an adequate message or code should be returned.

When returning history, only mutating events (create, update, delete) should be returned. The "get" events should not be recorded.

It is possible to create a key after it has been deleted. However, it is not possible to update a deleted key. For example the following event sequences are allowed:

create β†’ delete β†’ create β†’ update

create β†’ update β†’ delete β†’ create β†’ update

However, the following should not be allowed:

create β†’ delete β†’ update
create β†’ create

System Design

design of solution

diagram

Setup:

  • Run follow command:
make setup

Bind api:

make api-forward

Remove all:

  • Run follow command:
make remove-all

Testing

make test

##Documentation API Swagger

To watch, please click in the next link:

http://localhost:8080/swagger/index.html#/

These are detail endpoints

diagram

πŸ‘¨β€πŸ’» Full list what has been used:

About

API to store, update or get events


Languages

Language:Go 95.3%Language:Makefile 3.7%Language:Dockerfile 1.0%