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_customers
Database 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.go
OR
make run
go build -o bin/kwikemart .
make compile
make build
summon -p summon-conjur docker run --name kwik-e-mart -d \
--restart unless-stopped \
--env-file @SUMMONENVFILE \
-p 8080:8080
nfmsjoeg/kwik-e-mart:latest
OR
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