Skip to content

Instantly share code, notes, and snippets.

@deekoder
Created October 17, 2017 16:56
Show Gist options
  • Select an option

  • Save deekoder/1519163f1891e70d1106ed5e97cf833c to your computer and use it in GitHub Desktop.

Select an option

Save deekoder/1519163f1891e70d1106ed5e97cf833c to your computer and use it in GitHub Desktop.

Revisions

  1. deekoder revised this gist Oct 17, 2017. No changes.
  2. deekoder created this gist Oct 17, 2017.
    16 changes: 16 additions & 0 deletions SetBucketNotification.go
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    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")
    }