mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
rpc: expose Server type to allow multiple RPC Server instances
R=r, rsc, msolo, sougou CC=golang-dev https://golang.org/cl/2696041
This commit is contained in:
parent
904adfdc46
commit
250ac87368
4 changed files with 152 additions and 63 deletions
|
|
@ -61,8 +61,12 @@ func (m methodArray) Len() int { return len(m) }
|
|||
func (m methodArray) Less(i, j int) bool { return m[i].name < m[j].name }
|
||||
func (m methodArray) Swap(i, j int) { m[i], m[j] = m[j], m[i] }
|
||||
|
||||
type debugHTTP struct {
|
||||
*Server
|
||||
}
|
||||
|
||||
// Runs at /debug/rpc
|
||||
func debugHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
func (server debugHTTP) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
// Build a sorted version of the data.
|
||||
var services = make(serviceArray, len(server.serviceMap))
|
||||
i := 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue