mirror of
https://github.com/minio/minio.git
synced 2025-12-01 22:02:33 -05:00
Controller Service proxies rpc calls to the corresponding servers
This commit is contained in:
@@ -20,6 +20,8 @@ import (
|
||||
"net/http"
|
||||
|
||||
router "github.com/gorilla/mux"
|
||||
jsonrpc "github.com/gorilla/rpc/v2"
|
||||
"github.com/gorilla/rpc/v2/json"
|
||||
)
|
||||
|
||||
// registerAPI - register all the object API handlers to their respective paths
|
||||
@@ -70,3 +72,12 @@ func getAPIHandler(conf APIConfig) (http.Handler, MinioAPI) {
|
||||
apiHandler := registerCustomMiddleware(mux, mwHandlers...)
|
||||
return apiHandler, minioAPI
|
||||
}
|
||||
|
||||
func getRPCServerHandler() http.Handler {
|
||||
s := jsonrpc.NewServer()
|
||||
s.RegisterCodec(json.NewCodec(), "application/json")
|
||||
s.RegisterService(new(serverServerService), "Server")
|
||||
mux := router.NewRouter()
|
||||
mux.Handle("/rpc", s)
|
||||
return mux
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user