mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
use package name correctly (#5827)
This commit is contained in:
parent
f16bfda2f2
commit
76cc65531c
@ -31,7 +31,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
router "github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/minio/minio/pkg/auth"
|
"github.com/minio/minio/pkg/auth"
|
||||||
"github.com/minio/minio/pkg/madmin"
|
"github.com/minio/minio/pkg/madmin"
|
||||||
)
|
)
|
||||||
@ -140,7 +140,7 @@ type adminXLTestBed struct {
|
|||||||
configPath string
|
configPath string
|
||||||
xlDirs []string
|
xlDirs []string
|
||||||
objLayer ObjectLayer
|
objLayer ObjectLayer
|
||||||
mux *router.Router
|
router *mux.Router
|
||||||
}
|
}
|
||||||
|
|
||||||
// prepareAdminXLTestBed - helper function that setups a single-node
|
// prepareAdminXLTestBed - helper function that setups a single-node
|
||||||
@ -182,14 +182,14 @@ func prepareAdminXLTestBed() (*adminXLTestBed, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Setup admin mgmt REST API handlers.
|
// Setup admin mgmt REST API handlers.
|
||||||
adminRouter := router.NewRouter()
|
adminRouter := mux.NewRouter()
|
||||||
registerAdminRouter(adminRouter)
|
registerAdminRouter(adminRouter)
|
||||||
|
|
||||||
return &adminXLTestBed{
|
return &adminXLTestBed{
|
||||||
configPath: rootPath,
|
configPath: rootPath,
|
||||||
xlDirs: xlDirs,
|
xlDirs: xlDirs,
|
||||||
objLayer: objLayer,
|
objLayer: objLayer,
|
||||||
mux: adminRouter,
|
router: adminRouter,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -299,7 +299,7 @@ func TestAdminVersionHandler(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rec := httptest.NewRecorder()
|
rec := httptest.NewRecorder()
|
||||||
adminTestBed.mux.ServeHTTP(rec, req)
|
adminTestBed.router.ServeHTTP(rec, req)
|
||||||
if http.StatusOK != rec.Code {
|
if http.StatusOK != rec.Code {
|
||||||
t.Errorf("Unexpected status code - got %d but expected %d",
|
t.Errorf("Unexpected status code - got %d but expected %d",
|
||||||
rec.Code, http.StatusOK)
|
rec.Code, http.StatusOK)
|
||||||
@ -440,7 +440,7 @@ func testServicesCmdHandler(cmd cmdType, t *testing.T) {
|
|||||||
globalMinioAddr = "127.0.0.1:9000"
|
globalMinioAddr = "127.0.0.1:9000"
|
||||||
initGlobalAdminPeers(mustGetNewEndpointList("http://127.0.0.1:9000/d1"))
|
initGlobalAdminPeers(mustGetNewEndpointList("http://127.0.0.1:9000/d1"))
|
||||||
|
|
||||||
// Setting up a go routine to simulate ServerMux's
|
// Setting up a go routine to simulate ServerRouter's
|
||||||
// handleServiceSignals for stop and restart commands.
|
// handleServiceSignals for stop and restart commands.
|
||||||
if cmd == restartCmd {
|
if cmd == restartCmd {
|
||||||
go testServiceSignalReceiver(cmd, t)
|
go testServiceSignalReceiver(cmd, t)
|
||||||
@ -459,7 +459,7 @@ func testServicesCmdHandler(cmd cmdType, t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rec := httptest.NewRecorder()
|
rec := httptest.NewRecorder()
|
||||||
adminTestBed.mux.ServeHTTP(rec, req)
|
adminTestBed.router.ServeHTTP(rec, req)
|
||||||
|
|
||||||
if cmd == statusCmd {
|
if cmd == statusCmd {
|
||||||
expectedInfo := madmin.ServiceStatus{
|
expectedInfo := madmin.ServiceStatus{
|
||||||
@ -543,7 +543,7 @@ func TestServiceSetCreds(t *testing.T) {
|
|||||||
rec := httptest.NewRecorder()
|
rec := httptest.NewRecorder()
|
||||||
|
|
||||||
// Execute request
|
// Execute request
|
||||||
adminTestBed.mux.ServeHTTP(rec, req)
|
adminTestBed.router.ServeHTTP(rec, req)
|
||||||
|
|
||||||
// Check if the http code response is expected
|
// Check if the http code response is expected
|
||||||
if rec.Code != testCase.ExpectedStatusCode {
|
if rec.Code != testCase.ExpectedStatusCode {
|
||||||
@ -636,7 +636,7 @@ func TestListLocksHandler(t *testing.T) {
|
|||||||
t.Fatalf("Test %d - Failed to sign list locks request - %v", i+1, err)
|
t.Fatalf("Test %d - Failed to sign list locks request - %v", i+1, err)
|
||||||
}
|
}
|
||||||
rec := httptest.NewRecorder()
|
rec := httptest.NewRecorder()
|
||||||
adminTestBed.mux.ServeHTTP(rec, req)
|
adminTestBed.router.ServeHTTP(rec, req)
|
||||||
if test.expectedStatus != rec.Code {
|
if test.expectedStatus != rec.Code {
|
||||||
t.Errorf("Test %d - Expected HTTP status code %d but received %d", i+1, test.expectedStatus, rec.Code)
|
t.Errorf("Test %d - Expected HTTP status code %d but received %d", i+1, test.expectedStatus, rec.Code)
|
||||||
}
|
}
|
||||||
@ -703,7 +703,7 @@ func TestClearLocksHandler(t *testing.T) {
|
|||||||
t.Fatalf("Test %d - Failed to sign clear locks request - %v", i+1, err)
|
t.Fatalf("Test %d - Failed to sign clear locks request - %v", i+1, err)
|
||||||
}
|
}
|
||||||
rec := httptest.NewRecorder()
|
rec := httptest.NewRecorder()
|
||||||
adminTestBed.mux.ServeHTTP(rec, req)
|
adminTestBed.router.ServeHTTP(rec, req)
|
||||||
if test.expectedStatus != rec.Code {
|
if test.expectedStatus != rec.Code {
|
||||||
t.Errorf("Test %d - Expected HTTP status code %d but received %d", i+1, test.expectedStatus, rec.Code)
|
t.Errorf("Test %d - Expected HTTP status code %d but received %d", i+1, test.expectedStatus, rec.Code)
|
||||||
}
|
}
|
||||||
@ -795,7 +795,7 @@ func TestGetConfigHandler(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rec := httptest.NewRecorder()
|
rec := httptest.NewRecorder()
|
||||||
adminTestBed.mux.ServeHTTP(rec, req)
|
adminTestBed.router.ServeHTTP(rec, req)
|
||||||
if rec.Code != http.StatusOK {
|
if rec.Code != http.StatusOK {
|
||||||
t.Errorf("Expected to succeed but failed with %d", rec.Code)
|
t.Errorf("Expected to succeed but failed with %d", rec.Code)
|
||||||
}
|
}
|
||||||
@ -829,7 +829,7 @@ func TestSetConfigHandler(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rec := httptest.NewRecorder()
|
rec := httptest.NewRecorder()
|
||||||
adminTestBed.mux.ServeHTTP(rec, req)
|
adminTestBed.router.ServeHTTP(rec, req)
|
||||||
if rec.Code != http.StatusOK {
|
if rec.Code != http.StatusOK {
|
||||||
t.Errorf("Expected to succeed but failed with %d", rec.Code)
|
t.Errorf("Expected to succeed but failed with %d", rec.Code)
|
||||||
}
|
}
|
||||||
@ -855,7 +855,7 @@ func TestSetConfigHandler(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rec := httptest.NewRecorder()
|
rec := httptest.NewRecorder()
|
||||||
adminTestBed.mux.ServeHTTP(rec, req)
|
adminTestBed.router.ServeHTTP(rec, req)
|
||||||
respBody := string(rec.Body.Bytes())
|
respBody := string(rec.Body.Bytes())
|
||||||
if rec.Code != http.StatusBadRequest ||
|
if rec.Code != http.StatusBadRequest ||
|
||||||
!strings.Contains(respBody, "Configuration data provided exceeds the allowed maximum of") {
|
!strings.Contains(respBody, "Configuration data provided exceeds the allowed maximum of") {
|
||||||
@ -874,7 +874,7 @@ func TestSetConfigHandler(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rec := httptest.NewRecorder()
|
rec := httptest.NewRecorder()
|
||||||
adminTestBed.mux.ServeHTTP(rec, req)
|
adminTestBed.router.ServeHTTP(rec, req)
|
||||||
respBody := string(rec.Body.Bytes())
|
respBody := string(rec.Body.Bytes())
|
||||||
if rec.Code != http.StatusBadRequest ||
|
if rec.Code != http.StatusBadRequest ||
|
||||||
!strings.Contains(respBody, "JSON configuration provided has objects with duplicate keys") {
|
!strings.Contains(respBody, "JSON configuration provided has objects with duplicate keys") {
|
||||||
@ -904,7 +904,7 @@ func TestAdminServerInfo(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rec := httptest.NewRecorder()
|
rec := httptest.NewRecorder()
|
||||||
adminTestBed.mux.ServeHTTP(rec, req)
|
adminTestBed.router.ServeHTTP(rec, req)
|
||||||
if rec.Code != http.StatusOK {
|
if rec.Code != http.StatusOK {
|
||||||
t.Errorf("Expected to succeed but failed with %d", rec.Code)
|
t.Errorf("Expected to succeed but failed with %d", rec.Code)
|
||||||
}
|
}
|
||||||
@ -1105,7 +1105,7 @@ func collectHealResults(t *testing.T, adminTestBed *adminXLTestBed, bucket,
|
|||||||
}
|
}
|
||||||
req := mkHealStatusReq(t, bucket, prefix, clientToken)
|
req := mkHealStatusReq(t, bucket, prefix, clientToken)
|
||||||
rec := httptest.NewRecorder()
|
rec := httptest.NewRecorder()
|
||||||
adminTestBed.mux.ServeHTTP(rec, req)
|
adminTestBed.router.ServeHTTP(rec, req)
|
||||||
if http.StatusOK != rec.Code {
|
if http.StatusOK != rec.Code {
|
||||||
t.Errorf("Unexpected status code - got %d but expected %d",
|
t.Errorf("Unexpected status code - got %d but expected %d",
|
||||||
rec.Code, http.StatusOK)
|
rec.Code, http.StatusOK)
|
||||||
@ -1151,7 +1151,7 @@ func TestHealStartNStatusHandler(t *testing.T) {
|
|||||||
{
|
{
|
||||||
req := mkHealStartReq(t, bucketName, objName, healOpts)
|
req := mkHealStartReq(t, bucketName, objName, healOpts)
|
||||||
rec := httptest.NewRecorder()
|
rec := httptest.NewRecorder()
|
||||||
adminTestBed.mux.ServeHTTP(rec, req)
|
adminTestBed.router.ServeHTTP(rec, req)
|
||||||
if http.StatusOK != rec.Code {
|
if http.StatusOK != rec.Code {
|
||||||
t.Errorf("Unexpected status code - got %d but expected %d",
|
t.Errorf("Unexpected status code - got %d but expected %d",
|
||||||
rec.Code, http.StatusOK)
|
rec.Code, http.StatusOK)
|
||||||
@ -1171,7 +1171,7 @@ func TestHealStartNStatusHandler(t *testing.T) {
|
|||||||
// test with an invalid client token
|
// test with an invalid client token
|
||||||
req := mkHealStatusReq(t, bucketName, objName, hss.ClientToken+hss.ClientToken)
|
req := mkHealStatusReq(t, bucketName, objName, hss.ClientToken+hss.ClientToken)
|
||||||
rec := httptest.NewRecorder()
|
rec := httptest.NewRecorder()
|
||||||
adminTestBed.mux.ServeHTTP(rec, req)
|
adminTestBed.router.ServeHTTP(rec, req)
|
||||||
if rec.Code != http.StatusBadRequest {
|
if rec.Code != http.StatusBadRequest {
|
||||||
t.Errorf("Unexpected status code")
|
t.Errorf("Unexpected status code")
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ package cmd
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
router "github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -31,11 +31,11 @@ type adminAPIHandlers struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// registerAdminRouter - Add handler functions for each service REST API routes.
|
// registerAdminRouter - Add handler functions for each service REST API routes.
|
||||||
func registerAdminRouter(mux *router.Router) {
|
func registerAdminRouter(router *mux.Router) {
|
||||||
|
|
||||||
adminAPI := adminAPIHandlers{}
|
adminAPI := adminAPIHandlers{}
|
||||||
// Admin router
|
// Admin router
|
||||||
adminRouter := mux.NewRoute().PathPrefix(adminAPIPathPrefix).Subrouter()
|
adminRouter := router.PathPrefix(adminAPIPathPrefix).Subrouter()
|
||||||
|
|
||||||
// Version handler
|
// Version handler
|
||||||
adminRouter.Methods(http.MethodGet).Path("/version").HandlerFunc(adminAPI.VersionHandler)
|
adminRouter.Methods(http.MethodGet).Path("/version").HandlerFunc(adminAPI.VersionHandler)
|
||||||
|
@ -25,7 +25,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
router "github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/minio/minio/cmd/logger"
|
"github.com/minio/minio/cmd/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ func (s *adminCmd) CommitConfig(cArgs *CommitConfigArgs, cReply *CommitConfigRep
|
|||||||
|
|
||||||
// registerAdminRPCRouter - registers RPC methods for service status,
|
// registerAdminRPCRouter - registers RPC methods for service status,
|
||||||
// stop and restart commands.
|
// stop and restart commands.
|
||||||
func registerAdminRPCRouter(mux *router.Router) error {
|
func registerAdminRPCRouter(router *mux.Router) error {
|
||||||
adminRPCHandler := &adminCmd{}
|
adminRPCHandler := &adminCmd{}
|
||||||
adminRPCServer := newRPCServer()
|
adminRPCServer := newRPCServer()
|
||||||
err := adminRPCServer.RegisterName("Admin", adminRPCHandler)
|
err := adminRPCServer.RegisterName("Admin", adminRPCHandler)
|
||||||
@ -227,7 +227,7 @@ func registerAdminRPCRouter(mux *router.Router) error {
|
|||||||
logger.LogIf(context.Background(), err)
|
logger.LogIf(context.Background(), err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
adminRouter := mux.NewRoute().PathPrefix(minioReservedBucketPath).Subrouter()
|
adminRouter := router.PathPrefix(minioReservedBucketPath).Subrouter()
|
||||||
adminRouter.Path(adminPath).Handler(adminRPCServer)
|
adminRouter.Path(adminPath).Handler(adminRPCServer)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ package cmd
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
router "github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/minio/minio/cmd/logger"
|
"github.com/minio/minio/cmd/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ type objectAPIHandlers struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// registerAPIRouter - registers S3 compatible APIs.
|
// registerAPIRouter - registers S3 compatible APIs.
|
||||||
func registerAPIRouter(mux *router.Router) {
|
func registerAPIRouter(router *mux.Router) {
|
||||||
var err error
|
var err error
|
||||||
var cacheConfig = globalServerConfig.GetCacheConfig()
|
var cacheConfig = globalServerConfig.GetCacheConfig()
|
||||||
if len(cacheConfig.Drives) > 0 {
|
if len(cacheConfig.Drives) > 0 {
|
||||||
@ -46,8 +46,8 @@ func registerAPIRouter(mux *router.Router) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// API Router
|
// API Router
|
||||||
apiRouter := mux.NewRoute().PathPrefix("/").Subrouter()
|
apiRouter := router.PathPrefix("/").Subrouter()
|
||||||
var routers []*router.Router
|
var routers []*mux.Router
|
||||||
if globalDomainName != "" {
|
if globalDomainName != "" {
|
||||||
routers = append(routers, apiRouter.Host("{bucket:.+}."+globalDomainName).Subrouter())
|
routers = append(routers, apiRouter.Host("{bucket:.+}."+globalDomainName).Subrouter())
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ package cmd
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
router "github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/minio/minio/cmd/logger"
|
"github.com/minio/minio/cmd/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ type browserPeerAPIHandlers struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Register RPC router
|
// Register RPC router
|
||||||
func registerBrowserPeerRPCRouter(mux *router.Router) error {
|
func registerBrowserPeerRPCRouter(router *mux.Router) error {
|
||||||
bpHandlers := &browserPeerAPIHandlers{AuthRPCServer{}}
|
bpHandlers := &browserPeerAPIHandlers{AuthRPCServer{}}
|
||||||
|
|
||||||
bpRPCServer := newRPCServer()
|
bpRPCServer := newRPCServer()
|
||||||
@ -47,7 +47,7 @@ func registerBrowserPeerRPCRouter(mux *router.Router) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
bpRouter := mux.NewRoute().PathPrefix(minioReservedBucketPath).Subrouter()
|
bpRouter := router.PathPrefix(minioReservedBucketPath).Subrouter()
|
||||||
bpRouter.Path(browserPeerPath).Handler(bpRPCServer)
|
bpRouter.Path(browserPeerPath).Handler(bpRPCServer)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
mux "github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/minio/minio-go/pkg/policy"
|
"github.com/minio/minio-go/pkg/policy"
|
||||||
"github.com/minio/minio-go/pkg/set"
|
"github.com/minio/minio-go/pkg/set"
|
||||||
"github.com/minio/minio/cmd/logger"
|
"github.com/minio/minio/cmd/logger"
|
||||||
|
@ -26,7 +26,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
humanize "github.com/dustin/go-humanize"
|
humanize "github.com/dustin/go-humanize"
|
||||||
mux "github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/minio/minio-go/pkg/policy"
|
"github.com/minio/minio-go/pkg/policy"
|
||||||
"github.com/minio/minio/cmd/logger"
|
"github.com/minio/minio/cmd/logger"
|
||||||
"github.com/minio/minio/pkg/wildcard"
|
"github.com/minio/minio/pkg/wildcard"
|
||||||
|
@ -21,14 +21,14 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
router "github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Test cross domain xml handler.
|
// Test cross domain xml handler.
|
||||||
func TestCrossXMLHandler(t *testing.T) {
|
func TestCrossXMLHandler(t *testing.T) {
|
||||||
// Server initialization.
|
// Server initialization.
|
||||||
mux := router.NewRouter().SkipClean(true)
|
router := mux.NewRouter().SkipClean(true)
|
||||||
handler := setCrossDomainPolicy(mux)
|
handler := setCrossDomainPolicy(router)
|
||||||
srv := httptest.NewServer(handler)
|
srv := httptest.NewServer(handler)
|
||||||
|
|
||||||
resp, err := http.Get(srv.URL + crossDomainXMLEntity)
|
resp, err := http.Get(srv.URL + crossDomainXMLEntity)
|
||||||
|
@ -29,7 +29,7 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/minio/cli"
|
"github.com/minio/cli"
|
||||||
miniohttp "github.com/minio/minio/cmd/http"
|
xhttp "github.com/minio/minio/cmd/http"
|
||||||
"github.com/minio/minio/cmd/logger"
|
"github.com/minio/minio/cmd/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
|
|||||||
// Add API router.
|
// Add API router.
|
||||||
registerAPIRouter(router)
|
registerAPIRouter(router)
|
||||||
|
|
||||||
globalHTTPServer = miniohttp.NewServer([]string{gatewayAddr}, registerHandlers(router, globalHandlers...), globalTLSCertificate)
|
globalHTTPServer = xhttp.NewServer([]string{gatewayAddr}, registerHandlers(router, globalHandlers...), globalTLSCertificate)
|
||||||
|
|
||||||
// Start server, automatically configures TLS if certs are available.
|
// Start server, automatically configures TLS if certs are available.
|
||||||
go func() {
|
go func() {
|
||||||
|
@ -25,7 +25,7 @@ import (
|
|||||||
|
|
||||||
humanize "github.com/dustin/go-humanize"
|
humanize "github.com/dustin/go-humanize"
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
miniohttp "github.com/minio/minio/cmd/http"
|
xhttp "github.com/minio/minio/cmd/http"
|
||||||
"github.com/minio/minio/pkg/auth"
|
"github.com/minio/minio/pkg/auth"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ var (
|
|||||||
|
|
||||||
globalTLSCertificate *tls.Certificate
|
globalTLSCertificate *tls.Certificate
|
||||||
|
|
||||||
globalHTTPServer *miniohttp.Server
|
globalHTTPServer *xhttp.Server
|
||||||
globalHTTPServerErrorCh = make(chan error)
|
globalHTTPServerErrorCh = make(chan error)
|
||||||
globalOSSignalCh = make(chan os.Signal, 1)
|
globalOSSignalCh = make(chan os.Signal, 1)
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ package cmd
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
router "github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -30,10 +30,10 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// registerHealthCheckRouter - add handler functions for liveness and readiness routes.
|
// registerHealthCheckRouter - add handler functions for liveness and readiness routes.
|
||||||
func registerHealthCheckRouter(mux *router.Router) {
|
func registerHealthCheckRouter(router *mux.Router) {
|
||||||
|
|
||||||
// Healthcheck router
|
// Healthcheck router
|
||||||
healthRouter := mux.NewRoute().PathPrefix(healthCheckPathPrefix).Subrouter()
|
healthRouter := router.PathPrefix(healthCheckPathPrefix).Subrouter()
|
||||||
|
|
||||||
// Liveness handler
|
// Liveness handler
|
||||||
healthRouter.Methods(http.MethodGet).Path(healthCheckLivenessPath).HandlerFunc(LivenessCheckHandler)
|
healthRouter.Methods(http.MethodGet).Path(healthCheckLivenessPath).HandlerFunc(LivenessCheckHandler)
|
||||||
|
@ -38,10 +38,10 @@ const (
|
|||||||
DefaultTCPKeepAliveTimeout = 10 * time.Second
|
DefaultTCPKeepAliveTimeout = 10 * time.Second
|
||||||
|
|
||||||
// DefaultReadTimeout - default timout to read data from accepted connection.
|
// DefaultReadTimeout - default timout to read data from accepted connection.
|
||||||
DefaultReadTimeout = 30 * time.Second
|
DefaultReadTimeout = 5 * time.Minute
|
||||||
|
|
||||||
// DefaultWriteTimeout - default timout to write data to accepted connection.
|
// DefaultWriteTimeout - default timout to write data to accepted connection.
|
||||||
DefaultWriteTimeout = 30 * time.Second
|
DefaultWriteTimeout = 5 * time.Minute
|
||||||
|
|
||||||
// DefaultMaxHeaderBytes - default maximum HTTP header size in bytes.
|
// DefaultMaxHeaderBytes - default maximum HTTP header size in bytes.
|
||||||
DefaultMaxHeaderBytes = 1 * humanize.MiByte
|
DefaultMaxHeaderBytes = 1 * humanize.MiByte
|
||||||
|
@ -23,7 +23,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
router "github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/minio/dsync"
|
"github.com/minio/dsync"
|
||||||
"github.com/minio/minio/cmd/logger"
|
"github.com/minio/minio/cmd/logger"
|
||||||
)
|
)
|
||||||
@ -87,22 +87,22 @@ func startLockMaintenance(lkSrv *lockServer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Register distributed NS lock handlers.
|
// Register distributed NS lock handlers.
|
||||||
func registerDistNSLockRouter(mux *router.Router, endpoints EndpointList) error {
|
func registerDistNSLockRouter(router *mux.Router, endpoints EndpointList) error {
|
||||||
// Start lock maintenance from all lock servers.
|
// Start lock maintenance from all lock servers.
|
||||||
startLockMaintenance(globalLockServer)
|
startLockMaintenance(globalLockServer)
|
||||||
|
|
||||||
// Register initialized lock servers to their respective rpc endpoints.
|
// Register initialized lock servers to their respective rpc endpoints.
|
||||||
return registerStorageLockers(mux, globalLockServer)
|
return registerStorageLockers(router, globalLockServer)
|
||||||
}
|
}
|
||||||
|
|
||||||
// registerStorageLockers - register locker rpc handlers for net/rpc library clients
|
// registerStorageLockers - register locker rpc handlers for net/rpc library clients
|
||||||
func registerStorageLockers(mux *router.Router, lkSrv *lockServer) error {
|
func registerStorageLockers(router *mux.Router, lkSrv *lockServer) error {
|
||||||
lockRPCServer := newRPCServer()
|
lockRPCServer := newRPCServer()
|
||||||
if err := lockRPCServer.RegisterName(lockServiceName, lkSrv); err != nil {
|
if err := lockRPCServer.RegisterName(lockServiceName, lkSrv); err != nil {
|
||||||
logger.LogIf(context.Background(), err)
|
logger.LogIf(context.Background(), err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
lockRouter := mux.PathPrefix(minioReservedBucketPath).Subrouter()
|
lockRouter := router.PathPrefix(minioReservedBucketPath).Subrouter()
|
||||||
lockRouter.Path(lockServicePath).Handler(lockRPCServer)
|
lockRouter.Path(lockServicePath).Handler(lockRPCServer)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
mux "github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/minio/minio/cmd/logger"
|
"github.com/minio/minio/cmd/logger"
|
||||||
"github.com/minio/minio/pkg/event"
|
"github.com/minio/minio/pkg/event"
|
||||||
"github.com/minio/minio/pkg/handlers"
|
"github.com/minio/minio/pkg/handlers"
|
||||||
|
@ -178,7 +178,7 @@ func registerS3PeerRPCRouter(router *mux.Router) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
subrouter := router.NewRoute().PathPrefix(minioReservedBucketPath).Subrouter()
|
subrouter := router.PathPrefix(minioReservedBucketPath).Subrouter()
|
||||||
subrouter.Path(s3Path).Handler(peerRPCServer)
|
subrouter.Path(s3Path).Handler(peerRPCServer)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ package cmd
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
router "github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
)
|
)
|
||||||
|
|
||||||
func newObjectLayerFn() (layer ObjectLayer) {
|
func newObjectLayerFn() (layer ObjectLayer) {
|
||||||
@ -34,27 +34,27 @@ func newCacheObjectsFn() CacheObjectLayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Composed function registering routers for only distributed XL setup.
|
// Composed function registering routers for only distributed XL setup.
|
||||||
func registerDistXLRouters(mux *router.Router, endpoints EndpointList) error {
|
func registerDistXLRouters(router *mux.Router, endpoints EndpointList) error {
|
||||||
// Register storage rpc router only if its a distributed setup.
|
// Register storage rpc router only if its a distributed setup.
|
||||||
err := registerStorageRPCRouters(mux, endpoints)
|
err := registerStorageRPCRouters(router, endpoints)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register distributed namespace lock.
|
// Register distributed namespace lock.
|
||||||
err = registerDistNSLockRouter(mux, endpoints)
|
err = registerDistNSLockRouter(router, endpoints)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register S3 peer communication router.
|
// Register S3 peer communication router.
|
||||||
err = registerS3PeerRPCRouter(mux)
|
err = registerS3PeerRPCRouter(router)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register RPC router for web related calls.
|
// Register RPC router for web related calls.
|
||||||
return registerBrowserPeerRPCRouter(mux)
|
return registerBrowserPeerRPCRouter(router)
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of some generic handlers which are applied for all incoming requests.
|
// List of some generic handlers which are applied for all incoming requests.
|
||||||
@ -100,38 +100,38 @@ var globalHandlers = []HandlerFunc{
|
|||||||
func configureServerHandler(endpoints EndpointList) (http.Handler, error) {
|
func configureServerHandler(endpoints EndpointList) (http.Handler, error) {
|
||||||
// Initialize router. `SkipClean(true)` stops gorilla/mux from
|
// Initialize router. `SkipClean(true)` stops gorilla/mux from
|
||||||
// normalizing URL path minio/minio#3256
|
// normalizing URL path minio/minio#3256
|
||||||
mux := router.NewRouter().SkipClean(true)
|
router := mux.NewRouter().SkipClean(true)
|
||||||
|
|
||||||
// Initialize distributed NS lock.
|
// Initialize distributed NS lock.
|
||||||
if globalIsDistXL {
|
if globalIsDistXL {
|
||||||
registerDistXLRouters(mux, endpoints)
|
registerDistXLRouters(router, endpoints)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add Admin RPC router
|
// Add Admin RPC router
|
||||||
err := registerAdminRPCRouter(mux)
|
err := registerAdminRPCRouter(router)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add Admin router.
|
// Add Admin router.
|
||||||
registerAdminRouter(mux)
|
registerAdminRouter(router)
|
||||||
|
|
||||||
// Add healthcheck router
|
// Add healthcheck router
|
||||||
registerHealthCheckRouter(mux)
|
registerHealthCheckRouter(router)
|
||||||
|
|
||||||
// Add server metrics router
|
// Add server metrics router
|
||||||
registerMetricsRouter(mux)
|
registerMetricsRouter(router)
|
||||||
|
|
||||||
// Register web router when its enabled.
|
// Register web router when its enabled.
|
||||||
if globalIsBrowserEnabled {
|
if globalIsBrowserEnabled {
|
||||||
if err := registerWebRouter(mux); err != nil {
|
if err := registerWebRouter(router); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add API router.
|
// Add API router.
|
||||||
registerAPIRouter(mux)
|
registerAPIRouter(router)
|
||||||
|
|
||||||
// Register rest of the handlers.
|
// Register rest of the handlers.
|
||||||
return registerHandlers(mux, globalHandlers...), nil
|
return registerHandlers(router, globalHandlers...), nil
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
router "github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ArithArgs struct {
|
type ArithArgs struct {
|
||||||
@ -49,10 +49,10 @@ func TestGoHTTPRPC(t *testing.T) {
|
|||||||
AuthRPCServer: AuthRPCServer{},
|
AuthRPCServer: AuthRPCServer{},
|
||||||
})
|
})
|
||||||
|
|
||||||
mux := router.NewRouter().SkipClean(true)
|
router := mux.NewRouter().SkipClean(true)
|
||||||
mux.Path("/foo").Handler(newServer)
|
router.Path("/foo").Handler(newServer)
|
||||||
|
|
||||||
httpServer := httptest.NewServer(mux)
|
httpServer := httptest.NewServer(router)
|
||||||
defer httpServer.Close()
|
defer httpServer.Close()
|
||||||
|
|
||||||
rootPath, err := newTestConfig("us-east-1")
|
rootPath, err := newTestConfig("us-east-1")
|
||||||
|
@ -26,7 +26,7 @@ import (
|
|||||||
|
|
||||||
"github.com/minio/cli"
|
"github.com/minio/cli"
|
||||||
"github.com/minio/dsync"
|
"github.com/minio/dsync"
|
||||||
miniohttp "github.com/minio/minio/cmd/http"
|
xhttp "github.com/minio/minio/cmd/http"
|
||||||
"github.com/minio/minio/cmd/logger"
|
"github.com/minio/minio/cmd/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -246,7 +246,7 @@ func serverMain(ctx *cli.Context) {
|
|||||||
// Initialize Admin Peers inter-node communication only in distributed setup.
|
// Initialize Admin Peers inter-node communication only in distributed setup.
|
||||||
initGlobalAdminPeers(globalEndpoints)
|
initGlobalAdminPeers(globalEndpoints)
|
||||||
|
|
||||||
globalHTTPServer = miniohttp.NewServer([]string{globalMinioAddr}, handler, globalTLSCertificate)
|
globalHTTPServer = xhttp.NewServer([]string{globalMinioAddr}, handler, globalTLSCertificate)
|
||||||
globalHTTPServer.ReadTimeout = globalConnReadTimeout
|
globalHTTPServer.ReadTimeout = globalConnReadTimeout
|
||||||
globalHTTPServer.WriteTimeout = globalConnWriteTimeout
|
globalHTTPServer.WriteTimeout = globalConnWriteTimeout
|
||||||
globalHTTPServer.UpdateBytesReadFunc = globalConnStats.incInputBytes
|
globalHTTPServer.UpdateBytesReadFunc = globalConnStats.incInputBytes
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
router "github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/minio/minio/cmd/logger"
|
"github.com/minio/minio/cmd/logger"
|
||||||
"github.com/minio/minio/pkg/disk"
|
"github.com/minio/minio/pkg/disk"
|
||||||
)
|
)
|
||||||
@ -221,7 +221,7 @@ func newStorageRPCServer(endpoints EndpointList) (servers []*storageServer, err
|
|||||||
}
|
}
|
||||||
|
|
||||||
// registerStorageRPCRouter - register storage rpc router.
|
// registerStorageRPCRouter - register storage rpc router.
|
||||||
func registerStorageRPCRouters(mux *router.Router, endpoints EndpointList) error {
|
func registerStorageRPCRouters(router *mux.Router, endpoints EndpointList) error {
|
||||||
// Initialize storage rpc servers for every disk that is hosted on this node.
|
// Initialize storage rpc servers for every disk that is hosted on this node.
|
||||||
storageRPCs, err := newStorageRPCServer(endpoints)
|
storageRPCs, err := newStorageRPCServer(endpoints)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -238,7 +238,7 @@ func registerStorageRPCRouters(mux *router.Router, endpoints EndpointList) error
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// Add minio storage routes.
|
// Add minio storage routes.
|
||||||
storageRouter := mux.PathPrefix(minioReservedBucketPath).Subrouter()
|
storageRouter := router.PathPrefix(minioReservedBucketPath).Subrouter()
|
||||||
storageRouter.Path(path.Join(storageRPCPath, stServer.path)).Handler(storageRPCServer)
|
storageRouter.Path(path.Join(storageRPCPath, stServer.path)).Handler(storageRPCServer)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -52,7 +52,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
router "github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/minio/minio-go/pkg/policy"
|
"github.com/minio/minio-go/pkg/policy"
|
||||||
"github.com/minio/minio-go/pkg/s3signer"
|
"github.com/minio/minio-go/pkg/s3signer"
|
||||||
"github.com/minio/minio/cmd/logger"
|
"github.com/minio/minio/cmd/logger"
|
||||||
@ -398,7 +398,7 @@ func StartTestServer(t TestErrHandler, instanceType string) TestServer {
|
|||||||
// The object Layer will be a temp back used for testing purpose.
|
// The object Layer will be a temp back used for testing purpose.
|
||||||
func initTestStorageRPCEndPoint(endpoints EndpointList) http.Handler {
|
func initTestStorageRPCEndPoint(endpoints EndpointList) http.Handler {
|
||||||
// Initialize router.
|
// Initialize router.
|
||||||
muxRouter := router.NewRouter().SkipClean(true)
|
muxRouter := mux.NewRouter().SkipClean(true)
|
||||||
registerStorageRPCRouters(muxRouter, endpoints)
|
registerStorageRPCRouters(muxRouter, endpoints)
|
||||||
return muxRouter
|
return muxRouter
|
||||||
}
|
}
|
||||||
@ -469,16 +469,16 @@ func StartTestPeersRPCServer(t TestErrHandler, instanceType string) TestServer {
|
|||||||
testRPCServer.Obj = objLayer
|
testRPCServer.Obj = objLayer
|
||||||
globalObjLayerMutex.Unlock()
|
globalObjLayerMutex.Unlock()
|
||||||
|
|
||||||
mux := router.NewRouter().SkipClean(true)
|
router := mux.NewRouter().SkipClean(true)
|
||||||
// need storage layer for bucket config storage.
|
// need storage layer for bucket config storage.
|
||||||
registerStorageRPCRouters(mux, endpoints)
|
registerStorageRPCRouters(router, endpoints)
|
||||||
// need API layer to send requests, etc.
|
// need API layer to send requests, etc.
|
||||||
registerAPIRouter(mux)
|
registerAPIRouter(router)
|
||||||
// module being tested is Peer RPCs router.
|
// module being tested is Peer RPCs router.
|
||||||
registerS3PeerRPCRouter(mux)
|
registerS3PeerRPCRouter(router)
|
||||||
|
|
||||||
// Run TestServer.
|
// Run TestServer.
|
||||||
testRPCServer.Server = httptest.NewServer(mux)
|
testRPCServer.Server = httptest.NewServer(router)
|
||||||
|
|
||||||
// initialize remainder of serverCmdConfig
|
// initialize remainder of serverCmdConfig
|
||||||
testRPCServer.endpoints = endpoints
|
testRPCServer.endpoints = endpoints
|
||||||
@ -2130,7 +2130,7 @@ func ExecObjectLayerStaleFilesTest(t *testing.T, objTest objTestStaleFilesType)
|
|||||||
defer removeRoots(erasureDisks)
|
defer removeRoots(erasureDisks)
|
||||||
}
|
}
|
||||||
|
|
||||||
func registerBucketLevelFunc(bucket *router.Router, api objectAPIHandlers, apiFunctions ...string) {
|
func registerBucketLevelFunc(bucket *mux.Router, api objectAPIHandlers, apiFunctions ...string) {
|
||||||
for _, apiFunction := range apiFunctions {
|
for _, apiFunction := range apiFunctions {
|
||||||
switch apiFunction {
|
switch apiFunction {
|
||||||
case "PostPolicy":
|
case "PostPolicy":
|
||||||
@ -2204,14 +2204,14 @@ func registerBucketLevelFunc(bucket *router.Router, api objectAPIHandlers, apiFu
|
|||||||
}
|
}
|
||||||
|
|
||||||
// registerAPIFunctions helper function to add API functions identified by name to the routers.
|
// registerAPIFunctions helper function to add API functions identified by name to the routers.
|
||||||
func registerAPIFunctions(muxRouter *router.Router, objLayer ObjectLayer, apiFunctions ...string) {
|
func registerAPIFunctions(muxRouter *mux.Router, objLayer ObjectLayer, apiFunctions ...string) {
|
||||||
if len(apiFunctions) == 0 {
|
if len(apiFunctions) == 0 {
|
||||||
// Register all api endpoints by default.
|
// Register all api endpoints by default.
|
||||||
registerAPIRouter(muxRouter)
|
registerAPIRouter(muxRouter)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// API Router.
|
// API Router.
|
||||||
apiRouter := muxRouter.NewRoute().PathPrefix("/").Subrouter()
|
apiRouter := muxRouter.PathPrefix("/").Subrouter()
|
||||||
// Bucket router.
|
// Bucket router.
|
||||||
bucketRouter := apiRouter.PathPrefix("/{bucket}").Subrouter()
|
bucketRouter := apiRouter.PathPrefix("/{bucket}").Subrouter()
|
||||||
|
|
||||||
@ -2241,7 +2241,7 @@ func registerAPIFunctions(muxRouter *router.Router, objLayer ObjectLayer, apiFun
|
|||||||
func initTestAPIEndPoints(objLayer ObjectLayer, apiFunctions []string) http.Handler {
|
func initTestAPIEndPoints(objLayer ObjectLayer, apiFunctions []string) http.Handler {
|
||||||
// initialize a new mux router.
|
// initialize a new mux router.
|
||||||
// goriilla/mux is the library used to register all the routes and handle them.
|
// goriilla/mux is the library used to register all the routes and handle them.
|
||||||
muxRouter := router.NewRouter().SkipClean(true)
|
muxRouter := mux.NewRouter().SkipClean(true)
|
||||||
if len(apiFunctions) > 0 {
|
if len(apiFunctions) > 0 {
|
||||||
// Iterate the list of API functions requested for and register them in mux HTTP handler.
|
// Iterate the list of API functions requested for and register them in mux HTTP handler.
|
||||||
registerAPIFunctions(muxRouter, objLayer, apiFunctions...)
|
registerAPIFunctions(muxRouter, objLayer, apiFunctions...)
|
||||||
@ -2258,7 +2258,7 @@ func initTestWebRPCEndPoint(objLayer ObjectLayer) http.Handler {
|
|||||||
globalObjLayerMutex.Unlock()
|
globalObjLayerMutex.Unlock()
|
||||||
|
|
||||||
// Initialize router.
|
// Initialize router.
|
||||||
muxRouter := router.NewRouter().SkipClean(true)
|
muxRouter := mux.NewRouter().SkipClean(true)
|
||||||
registerWebRouter(muxRouter)
|
registerWebRouter(muxRouter)
|
||||||
return muxRouter
|
return muxRouter
|
||||||
}
|
}
|
||||||
@ -2266,7 +2266,7 @@ func initTestWebRPCEndPoint(objLayer ObjectLayer) http.Handler {
|
|||||||
// Initialize browser RPC endpoint.
|
// Initialize browser RPC endpoint.
|
||||||
func initTestBrowserPeerRPCEndPoint() http.Handler {
|
func initTestBrowserPeerRPCEndPoint() http.Handler {
|
||||||
// Initialize router.
|
// Initialize router.
|
||||||
muxRouter := router.NewRouter().SkipClean(true)
|
muxRouter := mux.NewRouter().SkipClean(true)
|
||||||
registerBrowserPeerRPCRouter(muxRouter)
|
registerBrowserPeerRPCRouter(muxRouter)
|
||||||
return muxRouter
|
return muxRouter
|
||||||
}
|
}
|
||||||
@ -2320,7 +2320,7 @@ func StartTestS3PeerRPCServer(t TestErrHandler) (TestServer, []string) {
|
|||||||
globalObjLayerMutex.Unlock()
|
globalObjLayerMutex.Unlock()
|
||||||
|
|
||||||
// Register router on a new mux
|
// Register router on a new mux
|
||||||
muxRouter := router.NewRouter().SkipClean(true)
|
muxRouter := mux.NewRouter().SkipClean(true)
|
||||||
err = registerS3PeerRPCRouter(muxRouter)
|
err = registerS3PeerRPCRouter(muxRouter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("%s", err)
|
t.Fatalf("%s", err)
|
||||||
|
@ -23,7 +23,7 @@ import (
|
|||||||
|
|
||||||
"github.com/elazarl/go-bindata-assetfs"
|
"github.com/elazarl/go-bindata-assetfs"
|
||||||
"github.com/gorilla/handlers"
|
"github.com/gorilla/handlers"
|
||||||
router "github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
jsonrpc "github.com/gorilla/rpc/v2"
|
jsonrpc "github.com/gorilla/rpc/v2"
|
||||||
"github.com/gorilla/rpc/v2/json2"
|
"github.com/gorilla/rpc/v2/json2"
|
||||||
"github.com/minio/minio/browser"
|
"github.com/minio/minio/browser"
|
||||||
@ -60,7 +60,7 @@ func assetFS() *assetfs.AssetFS {
|
|||||||
const specialAssets = ".*index_bundle.*.js$|.*loader.css$|.*logo.svg$|.*firefox.png$|.*safari.png$|.*chrome.png$|.*favicon.ico$"
|
const specialAssets = ".*index_bundle.*.js$|.*loader.css$|.*logo.svg$|.*firefox.png$|.*safari.png$|.*chrome.png$|.*favicon.ico$"
|
||||||
|
|
||||||
// registerWebRouter - registers web router for serving minio browser.
|
// registerWebRouter - registers web router for serving minio browser.
|
||||||
func registerWebRouter(mux *router.Router) error {
|
func registerWebRouter(router *mux.Router) error {
|
||||||
// Initialize Web.
|
// Initialize Web.
|
||||||
web := &webAPIHandlers{
|
web := &webAPIHandlers{
|
||||||
ObjectAPI: newObjectLayerFn,
|
ObjectAPI: newObjectLayerFn,
|
||||||
@ -71,7 +71,7 @@ func registerWebRouter(mux *router.Router) error {
|
|||||||
codec := json2.NewCodec()
|
codec := json2.NewCodec()
|
||||||
|
|
||||||
// Minio browser router.
|
// Minio browser router.
|
||||||
webBrowserRouter := mux.NewRoute().PathPrefix(minioReservedBucketPath).Subrouter()
|
webBrowserRouter := router.PathPrefix(minioReservedBucketPath).Subrouter()
|
||||||
|
|
||||||
// Initialize json rpc handlers.
|
// Initialize json rpc handlers.
|
||||||
webRPC := jsonrpc.NewServer()
|
webRPC := jsonrpc.NewServer()
|
||||||
|
Loading…
Reference in New Issue
Block a user