mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -05:00
make notification as separate package (#5294)
* Remove old notification files * Add net package * Add event package * Modify minio to take new notification system
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Minio Cloud Storage, (C) 2015, 2016, 2017 Minio, Inc.
|
||||
* Minio Cloud Storage, (C) 2015, 2016, 2017, 2018 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -351,7 +351,10 @@ func UnstartedTestServer(t TestErrHandler, instanceType string) TestServer {
|
||||
globalMinioHost = host
|
||||
globalMinioPort = port
|
||||
globalMinioAddr = getEndpointsLocalAddr(testServer.Disks)
|
||||
initGlobalS3Peers(testServer.Disks)
|
||||
globalNotificationSys, err = NewNotificationSys(globalServerConfig, testServer.Disks)
|
||||
if err != nil {
|
||||
t.Fatalf("Unable to initialize queue configuration")
|
||||
}
|
||||
|
||||
return testServer
|
||||
}
|
||||
@@ -511,11 +514,6 @@ func resetGlobalNSLock() {
|
||||
}
|
||||
}
|
||||
|
||||
// reset Global event notifier.
|
||||
func resetGlobalEventnotify() {
|
||||
globalEventNotifier = nil
|
||||
}
|
||||
|
||||
func resetGlobalEndpoints() {
|
||||
globalEndpoints = EndpointList{}
|
||||
}
|
||||
@@ -558,8 +556,6 @@ func resetTestGlobals() {
|
||||
resetGlobalConfig()
|
||||
// Reset global NSLock.
|
||||
resetGlobalNSLock()
|
||||
// Reset global event notifier.
|
||||
resetGlobalEventnotify()
|
||||
// Reset global endpoints.
|
||||
resetGlobalEndpoints()
|
||||
// Reset global isXL flag.
|
||||
@@ -1637,18 +1633,6 @@ func getCompleteMultipartUploadURL(endPoint, bucketName, objectName, uploadID st
|
||||
return makeTestTargetURL(endPoint, bucketName, objectName, queryValue)
|
||||
}
|
||||
|
||||
// return URL for put bucket notification.
|
||||
func getPutBucketNotificationURL(endPoint, bucketName string) string {
|
||||
return getGetBucketNotificationURL(endPoint, bucketName)
|
||||
}
|
||||
|
||||
// return URL for get bucket notification.
|
||||
func getGetBucketNotificationURL(endPoint, bucketName string) string {
|
||||
queryValue := url.Values{}
|
||||
queryValue.Set("notification", "")
|
||||
return makeTestTargetURL(endPoint, bucketName, "", queryValue)
|
||||
}
|
||||
|
||||
// return URL for listen bucket notification.
|
||||
func getListenBucketNotificationURL(endPoint, bucketName string, prefixes, suffixes, events []string) string {
|
||||
queryValue := url.Values{}
|
||||
@@ -1720,7 +1704,7 @@ func newTestObjectLayer(endpoints EndpointList) (newObject ObjectLayer, err erro
|
||||
}
|
||||
|
||||
// Initialize a new event notifier.
|
||||
if err = initEventNotifier(xl); err != nil {
|
||||
if globalNotificationSys, err = NewNotificationSys(globalServerConfig, endpoints); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user