processes the GetNotification http response from the server.
(bucketName string, resp *http.Response)
| 107 | |
| 108 | // processes the GetNotification http response from the server. |
| 109 | func processBucketNotificationResponse(bucketName string, resp *http.Response) (notification.Configuration, error) { |
| 110 | if resp.StatusCode != http.StatusOK { |
| 111 | errResponse := httpRespToErrorResponse(resp, bucketName, "") |
| 112 | return notification.Configuration{}, errResponse |
| 113 | } |
| 114 | var bucketNotification notification.Configuration |
| 115 | err := xmlDecoder(resp.Body, &bucketNotification) |
| 116 | if err != nil { |
| 117 | return notification.Configuration{}, err |
| 118 | } |
| 119 | return bucketNotification, nil |
| 120 | } |
| 121 | |
| 122 | // ListenNotification listen for all events, this is a MinIO specific API |
| 123 | func (c *Client) ListenNotification(ctx context.Context, prefix, suffix string, events []string) <-chan notification.Info { |
no test coverage detected