The service is responsible for store frequently asked questions and answers. Provides simple CRUD API.
This project implements clean architecture in order to assure both high elasticity and reusability of the code.
internal/api
- can import any other layers.internal/infrastructure
- can import everything exceptapi
.internal/useCases
- should not import anything else thaninternal/app
or standard library (orutils
)internal/app
- should not import anything else than the standard library orutils
In order to reuse common code such as authorization and graceful shutdown this project utilizes also middleware pattern. Handlers are wrapped in pipelines where each step wraps and calls the next one.
Create FAQ object:
POST /faq
{
"question":"What is your name?",
"answer": "My name is Bot. Chat Bot :)"
}
Update FAQ object by ID:
PATCH /faq/:id
{
"question":"How are you, mr Bot?",
"answer": "I'm fine."
}
Get FAQ object by ID:
GET /faq/:id
Delete FAQ object by ID:
DELETE /faq/:id