go-exercises-backend, v1.0-beta
Posted on

Back-end of the service for solving programming exercises.
Beta of the major version. Implement producing solutions via the RabbitMQ message broker; add the wait-for-it script to the Docker image.
Change Log
- databases:
- storing data in the PostgreSQL database:
- add the
storages.CloseDB()function;
- add the
- storing data in the PostgreSQL database:
- interaction with queues:
- using the RabbitMQ message broker;
- common properties:
- automatic declaring of the used queues;
- passing of a message data in JSON;
- operations:
- producing solutions:
- concurrent producing;
- producing solutions:
- distributing:
- Docker image:
- add the wait-for-it script.
- Docker image:
Features
- RESTful API:
- models:
- task model:
- storing:
- title;
- description;
- boilerplate code;
- test cases:
- all test cases are represented by a single string;
- operations:
- getting all tasks;
- getting a single task by an ID;
- creating;
- updating by an ID;
- deleting by an ID;
- storing:
- solution model:
- storing:
- task ID;
- code;
- operations:
- getting all solutions by a task ID;
- getting a single solution by an ID;
- creating;
- storing:
- task model:
- representing:
- in a JSON:
- payloads:
- of requests;
- of responses;
- payloads:
- as a plain text:
- errors;
- in a JSON:
- models:
- server:
- storing settings in environment variables;
- supporting graceful shutdown;
- logging:
- logging requests;
- logging errors;
- panics:
- recovering on panics;
- logging of panics;
- databases:
- storing data in the PostgreSQL database;
- interaction with queues:
- using the RabbitMQ message broker;
- common properties:
- automatic declaring of the used queues;
- passing of a message data in JSON;
- operations:
- producing solutions:
- concurrent producing;
- producing solutions:
- distributing:
- Docker image;
- Docker Compose configuration.
Usage
$ go-exercises-backend
Environment variables:
SERVER_ADDRESS— server URI (default::8080);STORAGE_ADDRESS— PostgreSQL connection URI (default:postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable);MESSAGE_BROKER_ADDRESS— RabbitMQ connection URI (default:amqp://rabbitmq:rabbitmq@localhost:5672);SOLUTION_REGISTER_BUFFER_SIZE— solution registration channel capacity (default:1000);SOLUTION_REGISTER_CONCURRENCY— amount of solution registration threads (default:1000).
Repository
Link: https://github.com/thewizardplusplus/go-exercises-backend/tree/v1.0-beta.
Content: code.
License: MIT.