t10-challenge

module
v0.0.0-...-8b0b209 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2020 License: MIT

README

T10-CHALLENGE

Test Status Coverage Status Go Report Card

This repository contains the solution to the T10 Challenge.

Running the solution

To follow the steps bellow, you should have installed Docker and docker-compose.

To run locally as production, execute the command bellow

docker-compose -f docker-compose-prod.yml up --build

To execute the bellow database operations, set the DATABASE_URL envvar

# default prod database string connection, change this based on your settings
export DATABASE_URL=postgres://postgres:postgres@localhost:5432/t10_challenge?sslmode=disable

Apply the database migrations

docker run --rm -v $(pwd)/migrations:/migrations --network host migrate/migrate:v4.11.0 -path=/migrations -database ${DATABASE_URL} -verbose up

Populate the database with some users

docker run --rm -v $(pwd)/users.sql:/tmp/users.sql --network host postgres:12-alpine psql -Atx ${DATABASE_URL} -f "/tmp/users.sql"

The file "t10-challenge.postman_collection.json" contains a Postman Collection to interact with the challenge solution.

Directories

Path Synopsis
api
cmd
pkg
auth/repository/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
auth/service/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL