GoBankHub

command module
v0.0.0-...-9881aad Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 6 Imported by: 0

README

GoBankHub

Tools: dbdiagram.io Docker

Database Configuration

Database Schema

DB Schema

Postgres Docker

Documents of Postgres Use the command to get a lightweight image, it is good enough for this mini-project.

docker pull postgres:16-alpine

Then start a postgres instance by:

docker run --name postgres16 -p 5432:5432 -e POSTGRES_USER=root_user -e POSTGRES_PASSWORD=123456 -d postgres:16-alpine
docker exec -it postgres16 psql -U root_user
DB migration in Go
brew install golang-migrate
migrate create -ext sql -dir db/migration -seq init_schema

I have created a Makefile for convenience, by runnnig command below(in the root directory) to run a contanier and create db:

make postgres
make createdb

then run the command to make a migration:

migrate -path db/migration -database "postgresql://root_user:123456@localhost:5432/gobankhub?sslmode=disable" -verbose up

go mod tidy to update the dependencies.

CI/CD

Postgres service container

Docs

RESTful Http Json API

Viper

Docs Configur the environment files.

mockgen

mockgen -package mockdb -destination db/mock/store.go github.com/Mive667/GoBankHub/db/sqlc Store

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
db
mock
Package mockdb is a generated GoMock package.
Package mockdb is a generated GoMock package.

Jump to

Keyboard shortcuts

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