go-exercises-backend, v1.5
Posted on

Back-end of the service for solving programming exercises.
Perform refactoring; additionally return total result count along with pagination results.
Change Log
- RESTful API:
- models:
- task model:
- operations:
- getting all tasks:
- process pagination:
- additionally return total result count;
- process pagination:
- getting all tasks:
- operations:
- solution model:
- operations:
- getting all solutions by a task ID:
- process pagination:
- additionally return total result count;
- process pagination:
- getting a single solution by an ID:
- join a solution task data to the results;
- getting all solutions by a task ID:
- operations:
- task model:
- models:
- perform refactoring:
- update the github.com/thewizardplusplus/go-http-utils package;
- add the github.com/thewizardplusplus/go-rabbitmq-utils package;
- add the github.com/thewizardplusplus/go-sync-utils package;
- utilities:
- utility for managing users:
- rename to the
go-exercises-managerutility; - add to the Docker image.
- rename to the
- utility for managing users:
Installation of the go-exercises-manager Tool
Prepare the directory:
$ mkdir --parents "$(go env GOPATH)/src/github.com/thewizardplusplus/"
$ cd "$(go env GOPATH)/src/github.com/thewizardplusplus/"
Clone this repository:
$ git clone https://github.com/thewizardplusplus/go-exercises-backend.git
$ cd go-exercises-backend
Install dependencies with the dep tool:
$ dep ensure -vendor-only
Build the utility:
$ go install ./cmd/go-exercises-manager
Usage of the go-exercises-manager Tool
$ go-exercises-manager -h | --help
$ go-exercises-manager add-user [options]
Commands:
add-user— add the user.
Options:
-h,--help— show the context-sensitive help message and exit;-u STRING,--username STRING— username;-p STRING,--password STRING— user password (default: generated automatically);-c INTEGER,--cost INTEGER— cost of the user password hashing (range: from 4 to 31 inclusive; default:10);-l INTEGER,--length INTEGER— length of the user password to be generated (minimum: 6; default:6).
Environment variables:
STORAGE_ADDRESS— PostgreSQL connection URI (default:postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable).
Repository
Link: https://github.com/thewizardplusplus/go-exercises-backend/tree/v1.5.
Content: code.
License: MIT.