Skip to content

Simple example/scaffold of CRUD application with Go Language

Notifications You must be signed in to change notification settings

kgoralski/go-crud-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang CRUD Application Scaffold

This repository is outdated.

About

This code is written with very little experience with Golang. I did my best. CRs and PRs always welcome :)

Usage

API

docker-compose

If you want to setup docker environemnt just use ./scripts/docker-compose.yml with docker-compose.

Go to ./scripts directory and execute

# start docker environment
$ docker-compose up -d (--build)

# list running services
$ docker-compose ps

# stop all containers
$ docker-compose stop

# remove all containers
$ docker-compose rm

single docker

  • Build app: &docker build -t golang:go-app . && $docker run --name go-crud --network=host -it -d -p 8080:8080 golang:go-app
  • You can run localDB with: $docker run -d -p 3306:3306 --name mysql-db -e MYSQL_ROOT_PASSWORD=admin -d mysql:5.7

Run Locally:

  • start mysql on 3306 port (and execute db script - manually currently)
  • start app from IDE or after install with flag -env=dev and giving -configFilePath, ./go-crud-template -env=dev

Hints

  • My $GOPATH=$HOME/go
  • Project dir: /home/users/kgoralski/go/src/github.com/kgoralski/go-crud-template
  • Database inside Docker? Be warned.

Many thanks to @wendigo for a Code Review!

About

Simple example/scaffold of CRUD application with Go Language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •