summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/minio/minio-go/docs/API.md
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/minio/minio-go/docs/API.md')
-rw-r--r--vendor/github.com/minio/minio-go/docs/API.md347
1 files changed, 200 insertions, 147 deletions
diff --git a/vendor/github.com/minio/minio-go/docs/API.md b/vendor/github.com/minio/minio-go/docs/API.md
index 9977c5df9..0365c7fad 100644
--- a/vendor/github.com/minio/minio-go/docs/API.md
+++ b/vendor/github.com/minio/minio-go/docs/API.md
@@ -9,9 +9,9 @@
package main
import (
- "fmt"
+ "fmt"
- "github.com/minio/minio-go"
+ "github.com/minio/minio-go"
)
func main() {
@@ -22,7 +22,7 @@ func main() {
minioClient, err := minio.New("play.minio.io:9000", "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG", ssl)
if err != nil {
fmt.Println(err)
- return
+ return
}
}
@@ -35,9 +35,9 @@ func main() {
package main
import (
- "fmt"
+ "fmt"
- "github.com/minio/minio-go"
+ "github.com/minio/minio-go"
)
func main() {
@@ -48,18 +48,18 @@ func main() {
s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", ssl)
if err != nil {
fmt.Println(err)
- return
+ return
}
}
```
-| Bucket operations |Object operations | Presigned operations | Bucket Policy/Notification Operations |
-|:---|:---|:---|:---|
-|[`MakeBucket`](#MakeBucket) |[`GetObject`](#GetObject) | [`PresignedGetObject`](#PresignedGetObject) |[`SetBucketPolicy`](#SetBucketPolicy) |
-|[`ListBuckets`](#ListBuckets) |[`PutObject`](#PutObject) |[`PresignedPutObject`](#PresignedPutObject) | [`GetBucketPolicy`](#GetBucketPolicy) |
-|[`BucketExists`](#BucketExists) |[`CopyObject`](#CopyObject) |[`PresignedPostPolicy`](#PresignedPostPolicy) | [`ListBucketPolicies`](#ListBucketPolicies) |
-| [`RemoveBucket`](#RemoveBucket) |[`StatObject`](#StatObject) | | [`SetBucketNotification`](#SetBucketNotification) |
+| Bucket operations |Object operations | Presigned operations | Bucket Policy/Notification Operations | Client custom settings |
+|:---|:---|:---|:---|:---|
+|[`MakeBucket`](#MakeBucket) |[`GetObject`](#GetObject) | [`PresignedGetObject`](#PresignedGetObject) |[`SetBucketPolicy`](#SetBucketPolicy) | [`SetAppInfo`](#SetAppInfo) |
+|[`ListBuckets`](#ListBuckets) |[`PutObject`](#PutObject) |[`PresignedPutObject`](#PresignedPutObject) | [`GetBucketPolicy`](#GetBucketPolicy) | [`SetCustomTransport`](#SetCustomTransport) |
+|[`BucketExists`](#BucketExists) |[`CopyObject`](#CopyObject) |[`PresignedPostPolicy`](#PresignedPostPolicy) | [`ListBucketPolicies`](#ListBucketPolicies) | [`TraceOn`](#TraceOn) |
+| [`RemoveBucket`](#RemoveBucket) |[`StatObject`](#StatObject) | | [`SetBucketNotification`](#SetBucketNotification) | [`TraceOff`](#TraceOff) |
|[`ListObjects`](#ListObjects) |[`RemoveObject`](#RemoveObject) | | [`GetBucketNotification`](#GetBucketNotification) |
|[`ListObjectsV2`](#ListObjectsV2) | [`RemoveObjects`](#RemoveObjects) | | [`RemoveAllBucketNotification`](#RemoveAllBucketNotification) |
|[`ListIncompleteUploads`](#ListIncompleteUploads) | [`RemoveIncompleteUpload`](#RemoveIncompleteUpload) | | [`ListenBucketNotification`](#ListenBucketNotification) |
@@ -77,10 +77,10 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`endpoint` | _string_ |S3 object storage endpoint. |
-| `accessKeyID` |_string_ | Access key for the object storage endpoint. |
-| `secretAccessKey` | _string_ |Secret key for the object storage endpoint. |
-|`ssl` | _bool_ | Set this value to 'true' to enable secure (HTTPS) access. |
+|`endpoint` | _string_ |S3 compatible object storage endpoint |
+|`accessKeyID` |_string_ |Access key for the object storage |
+|`secretAccessKey` | _string_ |Secret key for the object storage |
+|`ssl` | _bool_ | If 'true' API requests will be secure (HTTPS), and insecure (HTTP) otherwise |
## 2. Bucket operations
@@ -94,8 +94,8 @@ __Parameters__
| Param | Type | Description |
|---|---|---|
-|`bucketName` | _string_ | Name of the bucket. |
-| `location` | _string_ | Default value is us-east-1 Region where the bucket is created. Valid values are listed below:|
+|`bucketName` | _string_ | Name of the bucket |
+| `location` | _string_ | Region where the bucket is to be created. Default value is us-east-1. Other valid values are listed below. Note: When used with minio server, use the region specified in its config file (defaults to us-east-1).|
| | |us-east-1 |
| | |us-west-1 |
| | |us-west-2 |
@@ -104,7 +104,7 @@ __Parameters__
| | | ap-southeast-1|
| | | ap-northeast-1|
| | | ap-southeast-2|
-| | | sa-east-1|
+| | | sa-east-1|
__Example__
@@ -128,30 +128,30 @@ Lists all buckets.
| Param | Type | Description |
|---|---|---|
-|`bucketList` | _[]BucketInfo_ | Lists bucket in following format shown below: |
+|`bucketList` | _[]BucketInfo_ | Lists of all buckets |
| Param | Type | Description |
|---|---|---|
-|`bucket.Name` | _string_ | bucket name. |
-|`bucket.CreationDate` | _time.Time_ | date when bucket was created. |
+|`bucket.Name` | _string_ | Name of the bucket |
+|`bucket.CreationDate` | _time.Time_ | Date of bucket creation |
- __Example__
+__Example__
-
- ```go
- buckets, err := minioClient.ListBuckets()
-if err != nil {
+```go
+
+buckets, err := minioClient.ListBuckets()
+ if err != nil {
fmt.Println(err)
return
}
for _, bucket := range buckets {
- fmt.Println(bucket)
-}
+ fmt.Println(bucket)
+}
- ```
+```
<a name="BucketExists"></a>
### BucketExists(bucketName string) (found bool, err error)
@@ -163,15 +163,15 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
+|`bucketName` | _string_ |Name of the bucket |
__Return Values__
|Param |Type |Description |
|:---|:---| :---|
-|`found` | _bool_ | indicates whether bucket exists or not |
-|`err` | _error_ | standard error |
+|`found` | _bool_ | Indicates whether bucket exists or not |
+|`err` | _error_ | Standard Error |
__Example__
@@ -200,7 +200,7 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
+|`bucketName` | _string_ |Name of the bucket |
__Example__
@@ -225,24 +225,24 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
-| `objectPrefix` |_string_ | the prefix of the objects that should be listed. |
-| `recursive` | _bool_ |`true` indicates recursive style listing and `false` indicates directory style listing delimited by '/'. |
-|`doneCh` | _chan struct{}_ | Set this value to 'true' to enable secure (HTTPS) access. |
+|`bucketName` | _string_ |Name of the bucket |
+|`objectPrefix` |_string_ | Prefix of objects to be listed |
+|`recursive` | _bool_ |`true` indicates recursive style listing and `false` indicates directory style listing delimited by '/'. |
+|`doneCh` | _chan struct{}_ | A message on this channel ends the ListObjects iterator. |
__Return Value__
|Param |Type |Description |
|:---|:---| :---|
-|`chan ObjectInfo` | _chan ObjectInfo_ |Read channel for all the objects in the bucket, the object is of the format listed below: |
+|`chan ObjectInfo` | _chan ObjectInfo_ |Read channel for all objects in the bucket, the object is of the format listed below: |
|Param |Type |Description |
|:---|:---| :---|
-|`objectInfo.Key` | _string_ |name of the object. |
-|`objectInfo.Size` | _int64_ |size of the object. |
-|`objectInfo.ETag` | _string_ |etag of the object. |
-|`objectInfo.LastModified` | _time.Time_ |modified time stamp. |
+|`objectInfo.Key` | _string_ |Name of the object |
+|`objectInfo.Size` | _int64_ |Size of the object |
+|`objectInfo.ETag` | _string_ |MD5 checksum of the object |
+|`objectInfo.LastModified` | _time.Time_ |Time when object was last modified |
```go
@@ -269,17 +269,17 @@ for object := range objectCh {
<a name="ListObjectsV2"></a>
### ListObjectsV2(bucketName string, prefix string, recursive bool, doneCh chan struct{}) <-chan ObjectInfo
-Lists objects in a bucket using the recommanded listing API v2
+Lists objects in a bucket using the recommended listing API v2
__Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
-| `objectPrefix` |_string_ | the prefix of the objects that should be listed. |
+|`bucketName` | _string_ |Name of the bucket |
+| `objectPrefix` |_string_ | Prefix of objects to be listed |
| `recursive` | _bool_ |`true` indicates recursive style listing and `false` indicates directory style listing delimited by '/'. |
-|`doneCh` | _chan struct{}_ | Set this value to 'true' to enable secure (HTTPS) access. |
+|`doneCh` | _chan struct{}_ | A message on this channel ends the ListObjectsV2 iterator. |
__Return Value__
@@ -290,10 +290,10 @@ __Return Value__
|Param |Type |Description |
|:---|:---| :---|
-|`objectInfo.Key` | _string_ |name of the object. |
-|`objectInfo.Size` | _int64_ |size of the object. |
-|`objectInfo.ETag` | _string_ |etag of the object. |
-|`objectInfo.LastModified` | _time.Time_ |modified time stamp. |
+|`objectInfo.Key` | _string_ |Name of the object |
+|`objectInfo.Size` | _int64_ |Size of the object |
+|`objectInfo.ETag` | _string_ |MD5 checksum of the object |
+|`objectInfo.LastModified` | _time.Time_ |Time when object was last modified |
```go
@@ -327,25 +327,25 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
-| `prefix` |_string_ | prefix of the object names that are partially uploaded |
+|`bucketName` | _string_ |Name of the bucket |
+| `prefix` |_string_ | Prefix of objects that are partially uploaded |
| `recursive` | _bool_ |`true` indicates recursive style listing and `false` indicates directory style listing delimited by '/'. |
-|`doneCh` | _chan struct{}_ | Set this value to 'true' to enable secure (HTTPS) access. |
+|`doneCh` | _chan struct{}_ | A message on this channel ends the ListenIncompleteUploads iterator. |
__Return Value__
|Param |Type |Description |
|:---|:---| :---|
-|`chan ObjectMultipartInfo` | _chan ObjectMultipartInfo_ |emits multipart objects of the format listed below: |
+|`chan ObjectMultipartInfo` | _chan ObjectMultipartInfo_ |Emits multipart objects of the format listed below: |
__Return Value__
|Param |Type |Description |
|:---|:---| :---|
-|`multiPartObjInfo.Key` | _string_ |name of the incomplete object. |
-|`multiPartObjInfo.UploadID` | _string_ |upload ID of the incomplete object.|
-|`multiPartObjInfo.Size` | _int64_ |size of the incompletely uploaded object.|
+|`multiPartObjInfo.Key` | _string_ |Name of incompletely uploaded object |
+|`multiPartObjInfo.UploadID` | _string_ |Upload ID of incompletely uploaded object |
+|`multiPartObjInfo.Size` | _int64_ |Size of incompletely uploaded object |
__Example__
@@ -383,8 +383,8 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
-|`objectName` | _string_ |name of the object. |
+|`bucketName` | _string_ |Name of the bucket |
+|`objectName` | _string_ |Name of the object |
__Return Value__
@@ -427,9 +427,9 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
-|`objectName` | _string_ |name of the object. |
-|`filePath` | _string_ |path to which the object data will be written to. |
+|`bucketName` | _string_ |Name of the bucket |
+|`objectName` | _string_ |Name of the object |
+|`filePath` | _string_ |Path to download object to |
__Example__
@@ -446,7 +446,7 @@ if err != nil {
```
<a name="PutObject"></a>
-### PutObject(bucketName string, objectName string, reader io.Reader, contentType string) (n int, err error)
+### PutObject(bucketName string, objectName string, reader io.Reader, contentType string) (n int, err error)
Uploads an object.
@@ -456,16 +456,16 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
-|`objectName` | _string_ |name of the object. |
-|`reader` | _io.Reader_ |Any golang object implementing io.Reader. |
-|`contentType` | _string_ |content type of the object. |
+|`bucketName` | _string_ |Name of the bucket |
+|`objectName` | _string_ |Name of the object |
+|`reader` | _io.Reader_ |Any Go type that implements io.Reader |
+|`contentType` | _string_ |Content type of the object |
__Example__
-Uploads objects that are less than 5MiB in a single PUT operation. For objects that are greater than the 5MiB in size, PutObject seamlessly uploads the object in chunks of 5MiB or more depending on the actual file size. The max upload size for an object is 5TB.
+Uploads objects that are less than 64MiB in a single PUT operation. For objects that are greater than 64MiB in size, PutObject seamlessly uploads the object in chunks of 64MiB or more depending on the actual file size. The max upload size for an object is 5TB.
In the event that PutObject fails to upload an object, the user may attempt to re-upload the same object. If the same object is being uploaded, PutObject API examines the previous partial attempt to upload this object and resumes automatically from where it left off.
@@ -499,10 +499,10 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
-|`objectName` | _string_ |name of the object. |
-|`objectSource` | _string_ |name of the object source. |
-|`conditions` | _CopyConditions_ |Collection of supported CopyObject conditions. [`x-amz-copy-source`, `x-amz-copy-source-if-match`, `x-amz-copy-source-if-none-match`, `x-amz-copy-source-if-unmodified-since`, `x-amz-copy-source-if-modified-since`].|
+|`bucketName` | _string_ |Name of the bucket |
+|`objectName` | _string_ |Name of the object |
+|`objectSource` | _string_ |Name of the source object |
+|`conditions` | _CopyConditions_ |Collection of supported CopyObject conditions. [`x-amz-copy-source`, `x-amz-copy-source-if-match`, `x-amz-copy-source-if-none-match`, `x-amz-copy-source-if-unmodified-since`, `x-amz-copy-source-if-modified-since`]|
__Example__
@@ -537,7 +537,7 @@ if err != nil {
<a name="FPutObject"></a>
### FPutObject(bucketName string, objectName string, filePath string, contentType string) error
-Uploads contents from a file to objectName.
+Uploads contents from a file to objectName.
__Parameters__
@@ -545,16 +545,16 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
-|`objectName` | _string_ |name of the object. |
-|`filePath` | _string_ |file path of the file to be uploaded. |
-|`contentType` | _string_ |content type of the object. |
+|`bucketName` | _string_ |Name of the bucket |
+|`objectName` | _string_ |Name of the object |
+|`filePath` | _string_ |Path to file to be uploaded |
+|`contentType` | _string_ |Content type of the object |
__Example__
-FPutObject uploads objects that are less than 5MiB in a single PUT operation. For objects that are greater than the 5MiB in size, FPutObject seamlessly uploads the object in chunks of 5MiB or more depending on the actual file size. The max upload size for an object is 5TB.
+FPutObject uploads objects that are less than 64MiB in a single PUT operation. For objects that are greater than the 64MiB in size, FPutObject seamlessly uploads the object in chunks of 64MiB or more depending on the actual file size. The max upload size for an object is 5TB.
In the event that FPutObject fails to upload an object, the user may attempt to re-upload the same object. If the same object is being uploaded, FPutObject API examines the previous partial attempt to upload this object and resumes automatically from where it left off.
@@ -579,28 +579,28 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
-|`objectName` | _string_ |name of the object. |
+|`bucketName` | _string_ |Name of the bucket |
+|`objectName` | _string_ |Name of the object |
__Return Value__
|Param |Type |Description |
|:---|:---| :---|
-|`objInfo` | _ObjectInfo_ |object stat info for format listed below: |
+|`objInfo` | _ObjectInfo_ |Object stat information |
|Param |Type |Description |
|:---|:---| :---|
-|`objInfo.LastModified` | _time.Time_ |modified time stamp. |
-|`objInfo.ETag` | _string_ |etag of the object.|
-|`objInfo.ContentType` | _string_ |Content-Type of the object.|
-|`objInfo.Size` | _int64_ |size of the object.|
+|`objInfo.LastModified` | _time.Time_ |Time when object was last modified |
+|`objInfo.ETag` | _string_ |MD5 checksum of the object|
+|`objInfo.ContentType` | _string_ |Content type of the object|
+|`objInfo.Size` | _int64_ |Size of the object|
__Example__
-
+
```go
objInfo, err := minioClient.StatObject("mybucket", "photo.jpg")
@@ -623,8 +623,8 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
-|`objectName` | _string_ |name of the object. |
+|`bucketName` | _string_ |Name of the bucket |
+|`objectName` | _string_ |Name of the object |
```go
@@ -639,22 +639,22 @@ if err != nil {
<a name="RemoveObjects"></a>
### RemoveObjects(bucketName string, objectsCh chan string) errorCh chan minio.RemoveObjectError
-Removes a list of objects obtained from an input channel. The call internally buffers up `1000` at
-a time and initiates a delete request to the server. Upon any error is sent through the error channel.
+Removes a list of objects obtained from an input channel. The call sends a delete request to the server up to 1000 objects at a time.
+The errors observed are sent over the error channel.
__Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
-|`objectsCh` | _chan string_ | write prefixes of objects to be removed |
+|`bucketName` | _string_ |Name of the bucket |
+|`objectsCh` | _chan string_ | Prefix of objects to be removed |
__Return Values__
|Param |Type |Description |
|:---|:---| :---|
-|`errorCh` | _chan minio.RemoveObjectError | read objects deletion errors |
+|`errorCh` | _chan minio.RemoveObjectError | Channel of errors observed during deletion. |
@@ -679,8 +679,8 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
-|`objectName` | _string_ |name of the object. |
+|`bucketName` | _string_ |Name of the bucket |
+|`objectName` | _string_ |Name of the object |
__Example__
@@ -708,10 +708,10 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
-|`objectName` | _string_ |name of the object. |
-|`expiry` | _time.Duration_ |expiry in seconds. |
-|`reqParams` | _url.Values_ |additional response header overrides supports _response-expires_, _response-content-type_, _response-cache-control_, _response-content-disposition_. |
+|`bucketName` | _string_ |Name of the bucket |
+|`objectName` | _string_ |Name of the object |
+|`expiry` | _time.Duration_ |Expiry of presigned URL in seconds |
+|`reqParams` | _url.Values_ |Additional response header overrides supports _response-expires_, _response-content-type_, _response-cache-control_, _response-content-disposition_. |
__Example__
@@ -738,7 +738,7 @@ if err != nil {
Generates a presigned URL for HTTP PUT operations. Browsers/Mobile clients may point to this URL to upload objects directly to a bucket even if it is private. This presigned URL can have an associated expiration time in seconds after which it is no longer operational. The default expiry is set to 7 days.
NOTE: you can upload to S3 only with specified object name.
-
+
__Parameters__
@@ -746,9 +746,9 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
-|`objectName` | _string_ |name of the object. |
-|`expiry` | _time.Duration_ |expiry in seconds. |
+|`bucketName` | _string_ |Name of the bucket |
+|`objectName` | _string_ |Name of the object |
+|`expiry` | _time.Duration_ |Expiry of presigned URL in seconds |
__Example__
@@ -763,7 +763,7 @@ if err != nil {
fmt.Println(err)
return
}
- fmt.Println(presignedURL)
+fmt.Println(presignedURL)
```
@@ -833,9 +833,9 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket.|
-|`objectPrefix` | _string_ |name of the object prefix.|
-|`policy` | _policy.BucketPolicy_ |policy can be:|
+|`bucketName` | _string_ |Name of the bucket|
+|`objectPrefix` | _string_ |Name of the object prefix|
+|`policy` | _policy.BucketPolicy_ |Policy can be one of the following: |
|| |policy.BucketPolicyNone|
| | |policy.BucketPolicyReadOnly|
|| |policy.BucketPolicyReadWrite|
@@ -847,7 +847,7 @@ __Return Values__
|Param |Type |Description |
|:---|:---| :---|
-|`err` | _error_ |standard error |
+|`err` | _error_ |Standard Error |
__Example__
@@ -875,8 +875,8 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
-|`objectPrefix` | _string_ |name of the object prefix |
+|`bucketName` | _string_ |Name of the bucket |
+|`objectPrefix` | _string_ |Prefix matching objects under the bucket |
__Return Values__
@@ -884,7 +884,7 @@ __Return Values__
|Param |Type |Description |
|:---|:---| :---|
|`bucketPolicy` | _policy.BucketPolicy_ |string that contains: `none`, `readonly`, `readwrite`, or `writeonly` |
-|`err` | _error_ |standard error |
+|`err` | _error_ |Standard Error |
__Example__
@@ -910,16 +910,16 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
-|`objectPrefix` | _string_ |name of the object prefix |
+|`bucketName` | _string_ |Name of the bucket |
+|`objectPrefix` | _string_ |Prefix matching objects under the bucket |
__Return Values__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketPolicies` | _map[string]BucketPolicy_ |map that contains object resources paths with their associated permissions |
-|`err` | _error_ |standard error |
+|`bucketPolicies` | _map[string]BucketPolicy_ |Map of object resource paths and their permissions |
+|`err` | _error_ |Standard Error |
__Example__
@@ -947,7 +947,7 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
+|`bucketName` | _string_ |Name of the bucket |
__Return Values__
@@ -955,7 +955,7 @@ __Return Values__
|Param |Type |Description |
|:---|:---| :---|
|`bucketNotification` | _BucketNotification_ |structure which holds all notification configurations|
-|`err` | _error_ |standard error |
+|`err` | _error_ |Standard Error |
__Example__
@@ -963,10 +963,11 @@ __Example__
```go
bucketNotification, err := minioClient.GetBucketNotification("mybucket")
if err != nil {
- for _, topicConfig := range bucketNotification.TopicConfigs {
- for _, e := range topicConfig.Events {
- fmt.Println(e + " event is enabled")
- }
+ log.Fatalf("Failed to get bucket notification configurations for mybucket - %v", err)
+}
+for _, topicConfig := range bucketNotification.TopicConfigs {
+ for _, e := range topicConfig.Events {
+ fmt.Println(e + " event is enabled")
}
}
```
@@ -981,15 +982,15 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
-|`bucketNotification` | _BucketNotification_ |bucket notification. |
+|`bucketName` | _string_ |Name of the bucket |
+|`bucketNotification` | _BucketNotification_ |Represents the XML to be sent to the configured web service |
__Return Values__
|Param |Type |Description |
|:---|:---| :---|
-|`err` | _error_ |standard error |
+|`err` | _error_ |Standard Error |
__Example__
@@ -1006,7 +1007,7 @@ bucketNotification := BucketNotification{}
bucketNotification.AddTopic(topicConfig)
err := c.SetBucketNotification(bucketName, bucketNotification)
if err != nil {
- fmt.Println("Cannot set the bucket notification: " + err)
+ fmt.Println("Unable to set the bucket notification: " + err)
}
```
@@ -1020,14 +1021,14 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ |name of the bucket. |
+|`bucketName` | _string_ |Name of the bucket |
__Return Values__
|Param |Type |Description |
|:---|:---| :---|
-|`err` | _error_ |standard error |
+|`err` | _error_ |Standard Error |
__Example__
@@ -1035,7 +1036,7 @@ __Example__
```go
err := c.RemoveAllBucketNotification(bucketName)
if err != nil {
- fmt.Println("Cannot remove bucket notifications.")
+ fmt.Println("Unable to remove bucket notifications.", err)
}
```
@@ -1056,20 +1057,20 @@ __Parameters__
|Param |Type |Description |
|:---|:---| :---|
-|`bucketName` | _string_ | Bucket to listen notifications from. |
-|`prefix` | _string_ | Object key prefix to filter notifications for. |
-|`suffix` | _string_ | Object key suffix to filter notifications for. |
-|`events` | _[]string_| Enables notifications for specific event types. |
-|`doneCh` | _chan struct{}_ | A message on this channel ends the ListenBucketNotification loop. |
+|`bucketName` | _string_ | Bucket to listen notifications on |
+|`prefix` | _string_ | Object key prefix to filter notifications for |
+|`suffix` | _string_ | Object key suffix to filter notifications for |
+|`events` | _[]string_| Enables notifications for specific event types |
+|`doneCh` | _chan struct{}_ | A message on this channel ends the ListenBucketNotification iterator |
__Return Values__
|Param |Type |Description |
|:---|:---| :---|
-|`chan NotificationInfo` | _chan_ | Read channel for all notificatons on bucket. |
-|`NotificationInfo` | _object_ | Notification object represents events info. |
-|`notificationInfo.Records` | _[]NotificationEvent_ | Collection of notification events. |
-|`notificationInfo.Err` | _error_ | Carries any error occurred during the operation. |
+|`chan NotificationInfo` | _chan_ | Read channel for all notificatons on bucket |
+|`NotificationInfo` | _object_ | Notification object represents events info |
+|`notificationInfo.Records` | _[]NotificationEvent_ | Collection of notification events |
+|`notificationInfo.Err` | _error_ | Carries any error occurred during the operation |
__Example__
@@ -1085,17 +1086,69 @@ defer close(doneCh)
// Listen for bucket notifications on "mybucket" filtered by prefix, suffix and events.
for notificationInfo := range minioClient.ListenBucketNotification("YOUR-BUCKET", "PREFIX", "SUFFIX", []string{
- "s3:ObjectCreated:*",
- "s3:ObjectRemoved:*",
-}, doneCh) {
- if notificationInfo.Err != nil {
- log.Fatalln(notificationInfo.Err)
- }
- log.Println(notificationInfo)
+ "s3:ObjectCreated:*",
+ "s3:ObjectRemoved:*",
+ }, doneCh) {
+ if notificationInfo.Err != nil {
+ log.Fatalln(notificationInfo.Err)
+ }
+ log.Println(notificationInfo)
}
```
-## 6. Explore Further
+## 6. Client custom settings
-- [Build your own Go Music Player App example](https://docs.minio.io/docs/go-music-player-app)
+<a name="SetAppInfo"></a>
+### SetAppInfo(appName string, appVersion string)
+Adds application details to User-Agent.
+
+__Parameters__
+
+| Param | Type | Description |
+|---|---|---|
+|`appName` | _string_ | Name of the application performing the API requests. |
+| `appVersion`| _string_ | Version of the application performing the API requests. |
+
+__Example__
+
+
+```go
+
+// Set Application name and version to be used in subsequent API requests.
+minioClient.SetAppInfo("myCloudApp", "1.0.0")
+
+```
+
+<a name="SetCustomTransport"></a>
+### SetCustomTransport(customHTTPTransport http.RoundTripper)
+Overrides default HTTP transport. This is usually needed for debugging
+or for adding custom TLS certificates.
+
+__Parameters__
+
+| Param | Type | Description |
+|---|---|---|
+|`customHTTPTransport` | _http.RoundTripper_ | Custom transport e.g, to trace API requests and responses for debugging purposes.|
+
+
+<a name="TraceOn"></a>
+### TraceOn(outputStream io.Writer)
+Enables HTTP tracing. The trace is written to the io.Writer
+provided. If outputStream is nil, trace is written to os.Stdout.
+
+__Parameters__
+
+| Param | Type | Description |
+|---|---|---|
+|`outputStream` | _io.Writer_ | HTTP trace is written into outputStream.|
+
+
+<a name="TraceOff"></a>
+### TraceOff()
+Disables HTTP tracing.
+
+
+## 7. Explore Further
+
+- [Build your own Go Music Player App example](https://docs.minio.io/docs/go-music-player-app)