Improve code further - this time further simplification of names

This commit is contained in:
Harshavardhana
2015-09-19 20:52:57 -07:00
parent 2721bef8da
commit 674631f9d8
15 changed files with 221 additions and 304 deletions

View File

@@ -80,7 +80,7 @@ func getNewAPI() MinioAPI {
}
// getAPIHandler api handler
func getAPIHandler() (http.Handler, MinioAPI) {
func getAPIHandler(minioAPI MinioAPI) http.Handler {
var mwHandlers = []MiddlewareHandler{
ValidContentTypeHandler,
TimeValidityHandler,
@@ -89,18 +89,16 @@ func getAPIHandler() (http.Handler, MinioAPI) {
// api.LoggingHandler, // Disabled logging until we bring in external logging support
CorsHandler,
}
mux := router.NewRouter()
minioAPI := getNewAPI()
registerAPI(mux, minioAPI)
apiHandler := registerCustomMiddleware(mux, mwHandlers...)
return apiHandler, minioAPI
return apiHandler
}
func getRPCServerHandler() http.Handler {
func getServerRPCHandler() http.Handler {
s := jsonrpc.NewServer()
s.RegisterCodec(json.NewCodec(), "application/json")
s.RegisterService(new(serverServerService), "Server")
s.RegisterService(new(serverRPCService), "Server")
mux := router.NewRouter()
mux.Handle("/rpc", s)
return mux