Created
October 17, 2017 16:56
-
-
Save deekoder/1519163f1891e70d1106ed5e97cf833c to your computer and use it in GitHub Desktop.
Sets up a bucket notification to Postgres
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func setUp() { | |
minioClient, err := minio.New("192.168.1.15:9000", "minio", "minio123", false) | |
if err != nil { | |
log.Fatalln(err) | |
} | |
queueArn := minio.NewArn("minio", "sqs", "", "1", "postgresql") | |
queueConfig := minio.NewNotificationConfig(queueArn) | |
queueConfig.AddEvents(minio.ObjectCreatedAll, minio.ObjectRemovedAll) | |
bucketNotification := minio.BucketNotification{} | |
bucketNotification.AddQueue(queueConfig) | |
err = minioClient.SetBucketNotification("barcodes", bucketNotification) | |
if err != nil { | |
fmt.Println("Unable to set the bucket notification: ", err) | |
} | |
fmt.Println("Set Bucket Notification successfully") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment