Get a working Go and Docker environment setup. Then you can start the development server using the following:
$ make git-hooks # install any necessary git-hooks
$ make run # run the web server
Verify you get a response by querying localhost:5000.
Below is a list of the most common Makefile commands you'll want to run.
Command | Description |
---|---|
make run |
This will run the web server. It will also ensure your keys have been generated and your dev database is running |
make test |
Runs the unit and integration tests |
make cover |
Generates a code coverage report |
make testdata |
Creates test data for your database |
make clean |
Tears down your dev environment. Removes any tools. |
make fmt |
Runs gofmt on your go code |
Configuration is specified one of three ways:
- Environment variable with a
SQMGR_CONF_
prefix, e.g.,SQMGR_CONF_JWT_PUBLIC_KEY
- In a file in the current directory named like
./config.yaml
or./config.json
- In a file in the
/etc/sqmgr/
directory like/etc/sqmgr/config.yaml
or/etc/sqmgr/config.json
The following options can be set:
Key | Description |
---|---|
dsn |
Database DSN. Default is host=localhost port=5432 user=postgres sslmode=disable |
jwt_private_key |
Required. Path to a PEM private key |
jwt_public_key |
Required. Path to a PEM public key |