golang-mvc-simple

module
v0.0.0-...-c806833 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT

README ΒΆ

🌐 Golang MVC

Simple MVC pattern for Golang

πŸ§ͺ Test

codecov

πŸ“ About

This is a simple MVC pattern for Golang. It's not a framework, it's just a simple pattern to help you organize your code.

πŸ“š How to use

πŸ“¦ Install

go run cmd/main.go

πŸ“Œ Get all soldiers

curl http://localhost:8080/soldier/

πŸ“Œ Add new soldier

curl -X POST -H "Content-Type: application/json" -d '{
      "id": 2,
      "name": "Alice",
      "rank": "Sergeant",
      "wife": "Eve",
      "salary": 40000,
      "home": true,
      "car": false,
      "corruption": false
  }' http://localhost:8080/soldier/

πŸ“Œ Update soldier infomation

curl -X PUT -H "Content-Type: application/json" -d '{
      "corruption": true
  }' http://localhost:8080/soldier/2

πŸ“Œ Get soldier infomation

curl http://localhost:8080/soldier/2

πŸ“Œ Delete soldier

curl -X DELETE http://localhost:8080/soldier/2

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

Directories ΒΆ

Path Synopsis
pkg
env

Jump to

Keyboard shortcuts

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