JUPITER is a governance-oriented microservice framework, which is being used for years at Douyu.
See the 中文文档 for the Chinese documentation.
func main() {
var app jupiter.Application
app.Startup()
app.Serve(startHTTPServer())
app.Serve(startGRPCServer())
app.Schedule(startWorker())
// app.Executor(startXxlJob())
app.Run()
}
func startHTTPServer() server.Server {
server := xecho.DefaultConfig().Build()
server.GET("/hello", func(ctx echo.Context) error {
return ctx.JSON(200, "Gopher Wuhan")
})
return server
}
func startGRPCServer() server.Server {
server := xgrpc.DefaultConfig().Build()
helloworld.RegisterGreeterServer(server.Server, new(greeter.Greeter))
return server
}
func startWorker() worker.Worker {
cron := xcron.DefaultConfig().Build()
cron.Schedule(xcron.Every(time.Second*10), xcron.FuncJob(func() error {
return nil
}))
return cron
}
// 注册xxl定时任务
/*
func startXxlJob() executor.Executor {
executor := xxl.DefaultConfig().Build()
executor.RegXJob(
NewTest(),
)
return executor
}
*/
More Example:
For bug report, questions and discussions please submit an issue.
Contributions are always welcomed! Please see CONTRIBUTING for detailed guidelines.
You can start with the issues labeled with good first issue.