Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/s1s1ty/go-mysql-crud
Example crud operation using Golang and MySql
https://github.com/s1s1ty/go-mysql-crud
golang mysql-database restful-api webapp
Last synced: 5 days ago
JSON representation
Example crud operation using Golang and MySql
- Host: GitHub
- URL: https://github.com/s1s1ty/go-mysql-crud
- Owner: s1s1ty
- Created: 2018-07-08T11:43:44.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-10T18:24:37.000Z (over 4 years ago)
- Last Synced: 2024-12-31T21:09:01.149Z (12 days ago)
- Topics: golang, mysql-database, restful-api, webapp
- Language: Go
- Homepage:
- Size: 4.11 MB
- Stars: 280
- Watchers: 10
- Forks: 101
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
- Dependency management
* [dep](https://github.com/golang/dep)
- Database
* [MySql](https://github.com/go-sql-driver/mysql)
- Routing
* [chi](https://github.com/go-chi/chi)## 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.gitcd go-mysql-crud
chmod +x run.sh
./run.shdocker-compose up
```