Skip to content

A golang microservice todolist framework. gin+gorm+mysql+redis+grpc+etcd

Notifications You must be signed in to change notification settings

hoyyul/microservice-toDoList

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

microservice-toDoList

A golang microservice framework built upon on gin, gorm, redis, grpc, etcd. The project follows the principles of clean architecture.

redis is used to store user tokens as a caching system. gRPC is used to manage communication between the gateway and microservices. etcd is used to handle service registration and discovery.

Main Dependencies

  • gin
  • gorm
  • redis
  • etcd
  • grpc
  • jwt-go
  • logrus
  • viper
  • protobuf

Directory Structure

Overall structure

├── app
│   ├── gateway
│   ├── task
│   └── user
├── config
│   ├── redis
│   └── sql
├── doc
├── global
├── pkg
│   ├── eTcd
│   ├── errmsg
│   ├── pb
│   │   ├── task_pb
│   │   └── user_pb
│   ├── resp
│   └── util
│       └── jwts
├── setting

Gateway structure

/gateway
├── cmd
├── internal
│   ├── cache
│   └── http
├── middleware
├── routes
└── rpc

User/Task service structure

/user
├── cmd
└── internal
    ├── repository
    │   ├── dao
    │   └── model
    └── service

How to run

docker-compose up -d
go run app/user/cmd/main.go
go run app/task/cmd/main.go

4.(gateway must be the final)

go run app/gateway/cmd/main.go

Test API

launch postman

postman postman postman

About

A golang microservice todolist framework. gin+gorm+mysql+redis+grpc+etcd

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages