English | 中文
moke-kit is a toolkit for building a microservices/monolithic in Go. You can develop as a monolithic service and deploy it as a microservice. Just like building with LEGO, you can assemble the service as you like.
- Inversion of control with uber/fx,assemble your service as you like.
- Builtin TLS, mTLS to build Zero Trust security.
- Builtin Token-based authentication, support JWT token.
- Builtin middlewares (rate limit, open telemetry, auth middleware,logging, panic recovery, etc.).
- Builtin Cache-Aside pattern for orm and nosql.
- Builtin Compare-and-swap to ensure db update consistency.
- Command client to interact with the server for independent testing.
- One command to generate proto, grpc, gateway, swagger and client code with buf.
- Servers:
- gRPC
- HTTP[grpc-gateway]
- TCP [zinx]
- Websocket [zinx]
- KCP [zinx]
- MQ:
- Orm:
- Cache:
- redis
- dragonfly
- Third Party:
- install gonew:
go install golang.org/x/tools/cmd/gonew@latest
- create a new project:
gonew github.com/gstones/moke-layout your.domain/myprog