module
Version:
v0.0.0-...-2233bd7
Opens a new window with list of versions in this module.
Published: Oct 27, 2021
License: MIT
Opens a new window with license information.
README
¶
verbose-couscous: Bookings and reservations
This is a repository for bookings and reservations project.
Prerequisites
- Connect to GitHub with SSH
- clone the repo using SSH
git clone git@github.com:dpthegrey/verbose-couscous.git
- install golang
- Soda or Pop should be installed for database migration
How to use?
In the project root directory
Linux/Unix environment
Copy content from database.yml.example
to a new file database.yml
at the same file location and fill in database
credentials.
The database.yml
should look similar to this
development:
dialect: postgres
database: bookings
user: John
password: passwordForJohnUser
host: 127.0.0.1
pool: 5
test:
url: {{envOr "TEST_DATABASE_URL" "postgres://postgres:postgres@127.0.0.1:5432/myapp_test"}}
production:
url: {{envOr "DATABASE_URL" "postgres://postgres:postgres@127.0.0.1:5432/myapp_production"}}
Database Migrations
- Run
soda migrate
to create db migrations & soda migrate down
if you want to delete Database migrations.
Run Golang Server
- give permissions to the bash file in the project root directory by
chmod +x run.sh
and then run the
binary ./run.sh
Windows environment
Testing
- Test using
go test
- Test using verbose mode
go test -v
- Check coverage
go test -cover
- Get test coverage as an HTML file
go test -coverprofile=coverage.out && go tool cover -html=coverage.out
(this
opens in web browser)
Directories
¶
cmd
|
|
|
|
internal
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.