mcs delete bucket event notification api (#36)

Co-authored-by: Lenin Alevski <alevsk.8772@gmail.com>
This commit is contained in:
César Nieto
2020-04-07 09:27:25 -07:00
committed by GitHub
parent b390ce309a
commit e0bb098e47
10 changed files with 619 additions and 4 deletions

View File

@@ -86,6 +86,7 @@ func (c minioClient) getBucketPolicy(bucketName string) (string, error) {
// that are used within this project.
type MCS3Client interface {
addNotificationConfig(arn string, events []string, prefix, suffix string, ignoreExisting bool) *probe.Error
removeNotificationConfig(arn string) *probe.Error
}
// Interface implementation
@@ -96,11 +97,16 @@ type mcS3Client struct {
client *mc.S3Client
}
// implements minio.ListBucketsWithContext(ctx)
// implements S3Client.AddNotificationConfig()
func (c mcS3Client) addNotificationConfig(arn string, events []string, prefix, suffix string, ignoreExisting bool) *probe.Error {
return c.client.AddNotificationConfig(arn, events, prefix, suffix, ignoreExisting)
}
// implements S3Client.RemoveNotificationConfig()
func (c mcS3Client) removeNotificationConfig(arn string) *probe.Error {
return c.client.RemoveNotificationConfig(arn)
}
// newMinioClient creates a new MinIO client to talk to the server
func newMinioClient() (*minio.Client, error) {
endpoint := getMinIOEndpoint()