mirror of
https://github.com/minio/minio.git
synced 2025-11-10 05:59:43 -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 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.
|
||||
@@ -23,6 +23,7 @@ import (
|
||||
|
||||
"github.com/minio/minio/pkg/auth"
|
||||
"github.com/minio/minio/pkg/errors"
|
||||
"github.com/minio/minio/pkg/event"
|
||||
"github.com/minio/minio/pkg/hash"
|
||||
)
|
||||
|
||||
@@ -950,6 +951,28 @@ func toAPIErrorCode(err error) (apiErr APIErrorCode) {
|
||||
apiErr = ErrPartsSizeUnequal
|
||||
case BucketPolicyNotFound:
|
||||
apiErr = ErrNoSuchBucketPolicy
|
||||
case *event.ErrInvalidEventName:
|
||||
apiErr = ErrEventNotification
|
||||
case *event.ErrInvalidARN:
|
||||
apiErr = ErrARNNotification
|
||||
case *event.ErrARNNotFound:
|
||||
apiErr = ErrARNNotification
|
||||
case *event.ErrUnknownRegion:
|
||||
apiErr = ErrRegionNotification
|
||||
case *event.ErrInvalidFilterName:
|
||||
apiErr = ErrFilterNameInvalid
|
||||
case *event.ErrFilterNamePrefix:
|
||||
apiErr = ErrFilterNamePrefix
|
||||
case *event.ErrFilterNameSuffix:
|
||||
apiErr = ErrFilterNameSuffix
|
||||
case *event.ErrInvalidFilterValue:
|
||||
apiErr = ErrFilterValueInvalid
|
||||
case *event.ErrDuplicateEventName:
|
||||
apiErr = ErrOverlappingConfigs
|
||||
case *event.ErrDuplicateQueueConfiguration:
|
||||
apiErr = ErrOverlappingFilterNotification
|
||||
case *event.ErrUnsupportedConfiguration:
|
||||
apiErr = ErrUnsupportedNotification
|
||||
default:
|
||||
apiErr = ErrInternalError
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user