Go-Chassis is a microservice framework for rapid development of microservices in Go
- Pluggable registrator and discovery service: Support Service center, istio pilot, kubernetes and file based registry, fit both client side discovery and server side discovery pattern
- Pluggable Protocol: You can custom your own protocol, by default support http and grpc
- Multiple server management: you can separate API by protocols and ports
- Circuit breaker: Protect your micro service system in runtime
- Route management: Able to route to different service based on weight and match rule to achieve Canary Release easily
- Client side Load balancing: Able to custom strategy
- Rate limiting: Both client side and server side rate limiting
- Pluggable Cipher: Able to custom your own cipher for AKSK and TLS certs
- Handler Chain: Able to add your own code during service calling for client and server side
- Metrics: Able to expose Prometheus metric API automatically and custom metrics reporter
- Tracing:Use opentracing-go as standard library, easy to integrate tracing impl
- Logger: You can custom your own writer to sink log, by default support file and stdout
- Hot-reconfiguraion: Powered by go-archaius, configurations can be reload in runtime, like load balancing, circuit breaker, rate limiting
- Dynamic Configuration framework: Powered by go-archaius, developer is able to develop a service which has hot-reconfiguration feature easily
- Fault Injection: In consumer side, you can inject faults to bring chaos testing into your system
You can check plugins to see more features
You can see more documentations in here
-
Install go 1.10+
-
Clone the project
git clone git@github.com:go-chassis/go-chassis.git
- Use go mod(go 1.11+, experimental but a recommended way)
cd go-chassis
GO111MODULE=on go mod download
#optional
GO111MODULE=on go mod vendor
You can check examples here
Now examples is migrating to here
Go-Chassis supports 3 types of communication protocol.
- Rest - REST is an approach that leverages the HTTP protocol for communication.
- Highway - This is a RPC communication protocol, it was deprecated.
- grpc - native grpc protocol, go chassis bring circuit breaker, route management etc to grpc.
Add -tags debug
into go build arguments before debugging, if your go version is go1.10 onward.
example:
go build -tags debug -o server -gcflags "all=-N -l" server.go
Chassis customized debug
tag to resolve dlv debug issue: