A simple Golang-based application that queries a PostgreSQL database named kwikemart to read and return customer data stored in the customers table.
$ make create_table
$ make insert_customersDatabase Name: kwikemart
Table Name: customers
| id | first_name | last_name | pmt_type |
|---|---|---|---|
| 1 | Homer | Simpson | cash |
| 2 | Montgomery | Burns | credit |
| 3 | Barney | Gumble | debit |
| 4 | Waylon | Smithers | cash |
| 5 | Ned | Flanders | credit |
Provided for Summon in secrets.yml.
| variable name | expected value |
|---|---|
| DB_HOST | hostname to PostgreSQL database |
| DB_USERNAME | username to use for authentication |
| DB_PASSWORD | password to use for authentication |
| DB_NAME | name of the database to connect to |
summon -p $provider_name go run main.goOR
make rungo build -o bin/kwikemart .make compilemake buildsummon -p summon-conjur docker run --name kwik-e-mart -d \
--restart unless-stopped \
--env-file @SUMMONENVFILE \
-p 8080:8080
nfmsjoeg/kwik-e-mart:latestOR
make docker_run$ open http://localhost:8080-------------------------------------------------------
Connected successfully to conjur-demo.xxxxxx.rds.amazonaws.com
Database Username: xxxxxx
Database Password: xxxxxx
-------------------------------------------------------
id first_name last_name pmt_type
-------------------------------------------------------
1 Homer Simpson cash
2 Montgomery Burns credit
3 Barney Gumble debit
4 Waylon Smithers cash
5 Ned Flanders credit