Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/baselrabia/book-api
https://github.com/baselrabia/book-api
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/baselrabia/book-api
- Owner: baselrabia
- Created: 2023-10-15T02:54:47.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-10-17T23:39:32.000Z (about 1 year ago)
- Last Synced: 2024-06-21T01:58:47.230Z (7 months ago)
- Language: Go
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Golang assignment 💻
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.
## Prequisites ✔️
1. Git
2. Golang
3. Docker (optional)## Assignment 📝
Fork this repository and commit your code to your own repository.
1. 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.
2. 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.
### Optionals
1. Add tests for you REST API.
2. Create a dockerfile for your application.## Tips 🧞
### Application example
_Endpoints:_
```sh
# 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:_
```json
{
"id": 1,
"name": "Fluffy",
"age": 3,
"breed": "cat"
}
```### Database
This package can be used to connect to a local SQLite database:
- https://github.com/mattn/go-sqlite3
If you want an ORM (Object Relational Mapping) library, you can use GORM:
- https://gorm.io/docs/connecting_to_the_database.html#SQLite
### REST API
For creating a HTTP server, you can use echo:
- https://github.com/labstack/echo
### REST API testing
Documentation for testing echo endpoints:
- https://echo.labstack.com/guide/testing/