This assignment will form the basis for the job interview. You will show-case your implementation and talk about the choices you made and obstacles if you encountered any.
- Git
- Golang
- Docker (optional)
Fork this repository and commit your code to your own repository.
- Create a simple Golang application that will serve a RESTful API with a resource of your choice (pets, books, memes, etc). The endpoints should support Create, Read, Update and Delete operations.
- The data should be persisted in a database like SQLite, MySQL, PostgreSQL, etc.
If you are stuck or want some inspiration see the tips below.
- Add tests for you REST API.
- Create a dockerfile for your application.
Endpoints:
# Get all pets
GET /pets
# Get a specific pet
GET /pets/:id
# Create a pet
POST /pets
# Update a pet
PUT /pets/:id
# Delete a pet
DELETE /pets/:id
Model:
{
"id": 1,
"name": "Fluffy",
"age": 3,
"breed": "cat"
}
This package can be used to connect to a local SQLite database:
If you want an ORM (Object Relational Mapping) library, you can use GORM:
For creating a HTTP server, you can use echo:
Documentation for testing echo endpoints: