jupiter

package module
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2022 License: Apache-2.0 Imports: 2 Imported by: 88

README

GoTest codecov go.dev reference Go Report Card license

JUPITER: Governance-oriented Microservice Framework

Introduction

JUPITER is a governance-oriented microservice framework, which is being used for years at Douyu.

Documentation

See the 中文文档 for the Chinese documentation.

Quick Start

func main() {
	var app jupiter.Application
	app.Startup()
	app.Serve(startHTTPServer())
	app.Serve(startGRPCServer())
	app.Schedule(startWorker())
	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
}

More Example:

Bugs and Feedback

For bug report, questions and discussions please submit an issue.

Contributing

Contributions are always welcomed! Please see CONTRIBUTING for detailed guidelines.

You can start with the issues labeled with good first issue.

Contact

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//StageAfterStop after app stop
	StageAfterStop uint32 = uint32(hooks.Stage_AfterStop)
	//StageBeforeStop before app stop
	StageBeforeStop = uint32(hooks.Stage_BeforeStop)
)
View Source
var WithConfigParser = application.WithConfigParser
View Source
var WithDisable = application.WithDisable

Functions

This section is empty.

Types

type Application

type Application = application.Application

Application is the framework's instance, it contains the servers, workers, client and configuration settings. Create an instance of Application, by using &Application{}

type Disable added in v0.2.4

type Disable = application.Disable
const (
	DisableParserFlag      Disable = application.DisableParserFlag
	DisableLoadConfig      Disable = application.DisableLoadConfig
	DisableDefaultGovernor Disable = application.DisableDefaultGovernor
)

type Option added in v0.2.4

type Option = application.Option

Directories

Path Synopsis
cmd
jupiter/new
You can use the "packr clean" command to clean up this, and any other packr generated files.
You can use the "packr clean" command to clean up this, and any other packr generated files.
jupiter/new/packrd
You can use the "packr2 clean" command to clean up this, and any other packr generated files.
You can use the "packr2 clean" command to clean up this, and any other packr generated files.
example module
pkg
util/xbuffer
Package buffer provides an implementation of an unbounded buffer.
Package buffer provides an implementation of an unbounded buffer.
util/xtime
https://github.com/siddontang/go/tree/master/time2
https://github.com/siddontang/go/tree/master/time2
util/xgeneric Module
test
e2e Module
tools
jupiter Module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL