go-exercises-manager
The utility for managing users.
Features
- commands:
- add a user:
- parameters:
- username;
- password:
- generate automatically by default;
- password hashing cost;
- generated password length.
Installation
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
$ go-exercises-manager -h | --help
$ go-exercises-manager add-user [options]
Commands:
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).