World Conquest Chronicles

World Conquest Chronicles

go-exercises-backend, v1.5

Back-end of the service for solving programming exercises.

Perform refactoring; additionally return total result count along with pagination results.

Change Log

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_ADDRESSPostgreSQL 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.