Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/autom8ter/engine
a plugin based grpc framework
https://github.com/autom8ter/engine
api autom8ter colemanword framework golang golang-library grpc microservices
Last synced: 8 days ago
JSON representation
a plugin based grpc framework
- Host: GitHub
- URL: https://github.com/autom8ter/engine
- Owner: autom8ter
- License: apache-2.0
- Created: 2019-03-20T06:43:14.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-05-03T05:47:15.000Z (over 5 years ago)
- Last Synced: 2024-06-19T06:53:53.835Z (5 months ago)
- Topics: api, autom8ter, colemanword, framework, golang, golang-library, grpc, microservices
- Language: Go
- Homepage:
- Size: 19 MB
- Stars: 16
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Engine
[Godoc](https://github.com/autom8ter/engine/blob/master/GODOC.md)
A Pluggable gRPC Microservice Framework
`go get github.com/autom8ter/engine`License: MIT
```go
//Embeded driver.PluginFunc is used to satisfy the driver.Plugin interface
type Example struct {
driver.PluginFunc
}//create new example with the generated registration function from grpc
func NewExample() Example {
e := Example{}
e.PluginFunc = func(s *grpc.Server) {
examplepb.RegisterEchoServiceServer(s, e)
}
return e
}
//examplepb methods excluded for brevityfunc main() {
if err := engine.New("tcp", ":8080").With(
//general options:
config.WithDebug(), //adds verbose logging for development
config.WithMaxConcurrentStreams(1000), //sets max concurrent server streams//plugins:
config.WithChannelz(), //adds a channelz service
config.WithReflection(), //adds a reflection service
config.WithHealthz(), //adds a healthz service
config.WithPlugins(examplepb.NewExample()),//unary middleware:
config.WithUnaryUUIDMiddleware(), //adds a unary uuid middleware
config.WithUnaryTraceMiddleware(), // adds a streaming opentracing middleware
config.WithUnaryLoggingMiddleware(), // adds a unary logging rmiddleware
config.WithUnaryRecoveryMiddleware(), // adds a unary recovery middleware//streaming middleware
config.WithStreamUUIDMiddleware(), //adds a streaming uuid middleware
config.WithStreamTraceMiddleware(), // adds a streaming opentracing middleware
config.WithStreamLoggingMiddleware(), //adds a streaming logging middleware
config.WithStreamRecoveryMiddleware(), // adds a streaming recovery middleware).Serve(); err != nil {
log.Fatalln(err.Error())
}
}```
The above engine configuration(minus the example service) can be created with:
engine.Default(network, addr string, debug bool).With(config.WithPlugins(...add plugins here))
---
## Driver
github.com/autom8ter/engine/driver
driver.Plugin is used to register grpc server implementations.
```go
//Plugin is an interface for representing gRPC server implementations.
type Plugin interface {
RegisterWithServer(*grpc.Server)
}//PluginFunc implements the Plugin interface.
type PluginFunc func(*grpc.Server)//RegisterWithServer is an interface for representing gRPC server implementations.
func (p PluginFunc) RegisterWithServer(s *grpc.Server) {
p(s)
}```
---
## Features/Scope/Roadmap
- [x] Support for custom gRPC Server options
- [x] Support for custom and chained Unary Interceptors
- [x] Support for custom and chained Stream Interceptors
- [x] GoDoc documentation for every exported Method
- [x] Channelz service option ref: https://godoc.org/google.golang.org/grpc/channelz
- [x] Reflection service option ref: https://godoc.org/google.golang.org/grpc/reflection
- [x] Healthz service option ref: https://godoc.org/google.golang.org/grpc/health
- [x] Unary logger middleware option
- [x] Unary recovery middleware option
- [x] Unary tracing middleware option
- [x] Stream logger middleware option
- [x] Stream recovery middleware option
- [x] Stream tracing middleware option
- [x] Unary metrics middleware option
- [x] Stream metrics middleware option---