Skip to content

Latest commit

 

History

History
82 lines (60 loc) · 2.29 KB

README.md

File metadata and controls

82 lines (60 loc) · 2.29 KB

brpcweb

Go Report Card Go Releases Godoc Go Reference LICENSE

brpcweb是专为baidurpc开发一套在线管理控制台,提供在线的服务管理功能。 想了解baidu rpc项目,请查看:[https://github.com/baidu-golang/pbrpc]

overview picture

pic/main.png

Usage

Installing

To start using timewheel, install Go and run go get:

$ go get github.com/jhunters/brpcweb

Start server

Change to your install directory.

./brpcweb

Or Build from source

$ git clone https://github.com/jhunters/brpcweb.git
$ cd brpcweb
$ go build main.go
$ ./main -http=:1031

Open your browser and visit http://localhost:1031

More screenshot

pic/rpcdetail.png

pic/rpcmethods.png

pic/qps.png

Embed web module into your baidu-rpc server

    // param1 listen address
    // param2 reqeust prefix path
    // database file store path 
	module, err := web.NewWebModule(":8080", "/", "./data")
	if err != nil {
		fmt.Println(err)
		return
	}
	defer module.Close()
    // add a rpc server from API
    module.AddRPCServer("本地", "localhost", *port)

	module.StartWeb() // 

more advance usage to publish web server with the same port of rpc server

demo/rpcserver-with-web.go

License

brpcweb is Apache 2.0 licensed.