UI-handler: remove minio-go dependancy.

This commit is contained in:
Krishna Srinivas
2016-03-31 19:27:29 +05:30
parent ae5c65d3c6
commit 331890c4c8
41 changed files with 146 additions and 7702 deletions
+5 -6
View File
@@ -25,16 +25,13 @@ import (
router "github.com/gorilla/mux"
jsonrpc "github.com/gorilla/rpc/v2"
"github.com/gorilla/rpc/v2/json2"
"github.com/minio/minio-go"
"github.com/minio/minio/pkg/fs"
"github.com/minio/miniobrowser"
)
// webAPI container for Web API.
type webAPI struct {
// FSPath filesystem path.
FSPath string
// Minio client instance.
Client *minio.Client
Filesystem fs.Filesystem
}
// indexHandler - Handler to serve index.html
@@ -76,7 +73,9 @@ func registerWebRouter(mux *router.Router, web *webAPI) {
webRPC.RegisterService(web, "Web")
// RPC handler at URI - /minio/rpc
webBrowserRouter.Path("/rpc").Handler(webRPC)
webBrowserRouter.Methods("POST").Path("/rpc").Handler(webRPC)
webBrowserRouter.Methods("PUT").Path("/upload/{bucket}/{object:.+}").HandlerFunc(web.Upload)
webBrowserRouter.Methods("GET").Path("/download/{bucket}/{object:.+}").Queries("token", "").HandlerFunc(web.Download)
// Add compression for assets.
compressedAssets := handlers.CompressHandler(http.StripPrefix(reservedBucket, http.FileServer(assetFS())))