API for virtual library management, where possible:
- Perform CRUD operations in books
- Upload the book to a Google Cloud Platform bucket
- Delete book from Google Cloud bucket
- Download books
See swagger.json
- Create the bucket
- Create a service account in the following directory:
/config/credentials
- Install docker
Docker is a software platform that allows developers to create, deploy, and run applications in containers. See the official documentation for install the version compatible with your OS: Install Docker Engine
- Run Docker Compose
docker compose -f ./config/docker/docker-compose.yml up -d --build
- Inside lib-api directory, run:
go mod vendor
- Setup the environment variables listed below in directory:
/config/env/envs.yaml
- Inside lib-api directory, run:
go run cmd/server/main.go
- Inside lib-api directory, run:
go test ./... -v
You should see messages like:
Name | Description | Default |
---|---|---|
DATABASE.USER | Username to access database | root |
DATABASE.PASSWORD | Password to access database | 12345678 |
GCP.BUCKET_NAME | Name of the bucket that will manage the book files on Google Cloud Platform | library |
GCP.CREDENTIALSPATH | Path of the service account that will give free access to the bucket | config/credentials/service_account.json |