abidhmuhsin / go-mysql-crud

Example crud operation using Golang and MySql

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-mysql-crud

Sample crud operation using Golang and MySql

API ENDPOINTS

All Posts

  • Path : /posts
  • Method: GET
  • Response: 200

Create Post

  • Path : /posts
  • Method: POST
  • Fields: title, content
  • Response: 201

Details a Post

  • Path : /posts/{id}
  • Method: GET
  • Response: 200

Update Post

  • Path : /posts/{id}
  • Method: PUT
  • Fields: title, content
  • Response: 200

Delete Post

  • Path : /posts/{id}
  • Method: DELETE
  • Response: 204

Required Packages

Quick Run Project

First clone the repo then go to go-mysql-crud folder. After that build your image and run by docker. Make sure you have docker in your machine.

git clone https://github.com/s1s1ty/go-mysql-crud.git

cd go-mysql-crud

chmod +x run.sh
./run.sh

docker-compose up

About

Example crud operation using Golang and MySql


Languages

Language:Go 96.5%Language:Shell 2.2%Language:Dockerfile 1.2%