From 6e2cb00008cbf09e556b00f87603797fcaa47e09 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 16 Apr 2018 05:37:14 -0700 Subject: Depenancy upgrades and movign to dep. (#8630) --- .../minio/minio-go/examples/s3/bucketexists.go | 52 ------------- .../minio/minio-go/examples/s3/composeobject.go | 78 ------------------- .../minio/minio-go/examples/s3/copyobject.go | 75 ------------------ .../minio-go/examples/s3/fgetobject-context.go | 54 ------------- .../minio/minio-go/examples/s3/fgetobject.go | 46 ----------- .../minio-go/examples/s3/fputencrypted-object.go | 80 ------------------- .../minio-go/examples/s3/fputobject-context.go | 53 ------------- .../minio/minio-go/examples/s3/fputobject.go | 48 ------------ .../minio-go/examples/s3/get-encrypted-object.go | 89 ---------------------- .../minio-go/examples/s3/getbucketnotification.go | 56 -------------- .../minio/minio-go/examples/s3/getbucketpolicy.go | 56 -------------- .../minio-go/examples/s3/getobject-context.go | 73 ------------------ .../minio/minio-go/examples/s3/getobject.go | 64 ---------------- .../minio-go/examples/s3/listbucketpolicies.go | 57 -------------- .../minio/minio-go/examples/s3/listbuckets.go | 49 ------------ .../minio-go/examples/s3/listincompleteuploads.go | 58 -------------- .../minio/minio-go/examples/s3/listobjects-N.go | 77 ------------------- .../minio/minio-go/examples/s3/listobjects.go | 58 -------------- .../minio/minio-go/examples/s3/listobjectsV2.go | 58 -------------- .../minio/minio-go/examples/s3/makebucket.go | 47 ------------ .../minio-go/examples/s3/presignedgetobject.go | 54 ------------- .../minio-go/examples/s3/presignedheadobject.go | 54 ------------- .../minio-go/examples/s3/presignedpostpolicy.go | 60 --------------- .../minio-go/examples/s3/presignedputobject.go | 48 ------------ .../minio-go/examples/s3/put-encrypted-object.go | 85 --------------------- .../minio-go/examples/s3/putobject-context.go | 68 ----------------- .../examples/s3/putobject-getobject-sse.go | 87 --------------------- .../minio-go/examples/s3/putobject-progress.go | 64 ---------------- .../examples/s3/putobject-s3-accelerate.go | 62 --------------- .../minio-go/examples/s3/putobject-streaming.go | 55 ------------- .../minio/minio-go/examples/s3/putobject.go | 58 -------------- .../examples/s3/removeallbucketnotification.go | 50 ------------ .../minio/minio-go/examples/s3/removebucket.go | 49 ------------ .../minio-go/examples/s3/removeincompleteupload.go | 47 ------------ .../minio/minio-go/examples/s3/removeobject.go | 46 ----------- .../minio/minio-go/examples/s3/removeobjects.go | 65 ---------------- .../minio-go/examples/s3/setbucketnotification.go | 86 --------------------- .../minio/minio-go/examples/s3/setbucketpolicy.go | 55 ------------- .../minio/minio-go/examples/s3/statobject.go | 46 ----------- 39 files changed, 2367 deletions(-) delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/bucketexists.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/composeobject.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/copyobject.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/fgetobject-context.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/fgetobject.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/fputencrypted-object.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/fputobject-context.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/fputobject.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/get-encrypted-object.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/getbucketnotification.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/getbucketpolicy.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/getobject-context.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/getobject.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/listbucketpolicies.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/listbuckets.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/listincompleteuploads.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/listobjects-N.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/listobjects.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/listobjectsV2.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/makebucket.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/presignedgetobject.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/presignedheadobject.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/presignedpostpolicy.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/presignedputobject.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/put-encrypted-object.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/putobject-context.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/putobject-getobject-sse.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/putobject-progress.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/putobject-s3-accelerate.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/putobject-streaming.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/putobject.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/removeallbucketnotification.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/removebucket.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/removeincompleteupload.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/removeobject.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/removeobjects.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/setbucketnotification.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/setbucketpolicy.go delete mode 100644 vendor/github.com/minio/minio-go/examples/s3/statobject.go (limited to 'vendor/github.com/minio/minio-go/examples/s3') diff --git a/vendor/github.com/minio/minio-go/examples/s3/bucketexists.go b/vendor/github.com/minio/minio-go/examples/s3/bucketexists.go deleted file mode 100644 index 20dea30a3..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/bucketexists.go +++ /dev/null @@ -1,52 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are - // dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - found, err := s3Client.BucketExists("my-bucketname") - if err != nil { - log.Fatalln(err) - } - - if found { - log.Println("Bucket found.") - } else { - log.Println("Bucket not found.") - } -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/composeobject.go b/vendor/github.com/minio/minio-go/examples/s3/composeobject.go deleted file mode 100644 index 2f76ff053..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/composeobject.go +++ /dev/null @@ -1,78 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - - minio "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-testfile, my-bucketname and - // my-objectname are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - // Enable trace. - // s3Client.TraceOn(os.Stderr) - - // Prepare source decryption key (here we assume same key to - // decrypt all source objects.) - decKey := minio.NewSSEInfo([]byte{1, 2, 3}, "") - - // Source objects to concatenate. We also specify decryption - // key for each - src1 := minio.NewSourceInfo("bucket1", "object1", &decKey) - src1.SetMatchETagCond("31624deb84149d2f8ef9c385918b653a") - - src2 := minio.NewSourceInfo("bucket2", "object2", &decKey) - src2.SetMatchETagCond("f8ef9c385918b653a31624deb84149d2") - - src3 := minio.NewSourceInfo("bucket3", "object3", &decKey) - src3.SetMatchETagCond("5918b653a31624deb84149d2f8ef9c38") - - // Create slice of sources. - srcs := []minio.SourceInfo{src1, src2, src3} - - // Prepare destination encryption key - encKey := minio.NewSSEInfo([]byte{8, 9, 0}, "") - - // Create destination info - dst, err := minio.NewDestinationInfo("bucket", "object", &encKey, nil) - if err != nil { - log.Fatalln(err) - } - - err = s3Client.ComposeObject(dst, srcs) - if err != nil { - log.Fatalln(err) - } - - log.Println("Composed object successfully.") -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/copyobject.go b/vendor/github.com/minio/minio-go/examples/s3/copyobject.go deleted file mode 100644 index a7c3eca45..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/copyobject.go +++ /dev/null @@ -1,75 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - "time" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-testfile, my-bucketname and - // my-objectname are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - // Enable trace. - // s3Client.TraceOn(os.Stderr) - - // Source object - src := minio.NewSourceInfo("my-sourcebucketname", "my-sourceobjectname", nil) - - // All following conditions are allowed and can be combined together. - - // Set modified condition, copy object modified since 2014 April. - src.SetModifiedSinceCond(time.Date(2014, time.April, 0, 0, 0, 0, 0, time.UTC)) - - // Set unmodified condition, copy object unmodified since 2014 April. - // src.SetUnmodifiedSinceCond(time.Date(2014, time.April, 0, 0, 0, 0, 0, time.UTC)) - - // Set matching ETag condition, copy object which matches the following ETag. - // src.SetMatchETagCond("31624deb84149d2f8ef9c385918b653a") - - // Set matching ETag except condition, copy object which does not match the following ETag. - // src.SetMatchETagExceptCond("31624deb84149d2f8ef9c385918b653a") - - // Destination object - dst, err := minio.NewDestinationInfo("my-bucketname", "my-objectname", nil, nil) - if err != nil { - log.Fatalln(err) - } - - // Initiate copy object. - err = s3Client.CopyObject(dst, src) - if err != nil { - log.Fatalln(err) - } - log.Println("Copied source object /my-sourcebucketname/my-sourceobjectname to destination /my-bucketname/my-objectname Successfully.") -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/fgetobject-context.go b/vendor/github.com/minio/minio-go/examples/s3/fgetobject-context.go deleted file mode 100644 index 6004baa14..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/fgetobject-context.go +++ /dev/null @@ -1,54 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - "time" - - "context" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname, my-objectname - // and my-filename.csv are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute) - defer cancel() - - if err := s3Client.FGetObjectWithContext(ctx, "my-bucketname", "my-objectname", "my-filename.csv", minio.GetObjectOptions{}); err != nil { - log.Fatalln(err) - } - log.Println("Successfully saved my-filename.csv") - -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/fgetobject.go b/vendor/github.com/minio/minio-go/examples/s3/fgetobject.go deleted file mode 100644 index 819a34f91..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/fgetobject.go +++ /dev/null @@ -1,46 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname, my-objectname - // and my-filename.csv are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - if err := s3Client.FGetObject("my-bucketname", "my-objectname", "my-filename.csv", minio.GetObjectOptions{}); err != nil { - log.Fatalln(err) - } - log.Println("Successfully saved my-filename.csv") -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/fputencrypted-object.go b/vendor/github.com/minio/minio-go/examples/s3/fputencrypted-object.go deleted file mode 100644 index 96eec7e8f..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/fputencrypted-object.go +++ /dev/null @@ -1,80 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - - "github.com/minio/minio-go" - "github.com/minio/minio-go/pkg/encrypt" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-testfile, my-bucketname and - // my-objectname are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - // Specify a local file that we will upload - filePath := "my-testfile" - - //// Build an asymmetric key from private and public files - // - // privateKey, err := ioutil.ReadFile("private.key") - // if err != nil { - // t.Fatal(err) - // } - // - // publicKey, err := ioutil.ReadFile("public.key") - // if err != nil { - // t.Fatal(err) - // } - // - // asymmetricKey, err := NewAsymmetricKey(privateKey, publicKey) - // if err != nil { - // t.Fatal(err) - // } - //// - - // Build a symmetric key - symmetricKey := encrypt.NewSymmetricKey([]byte("my-secret-key-00")) - - // Build encryption materials which will encrypt uploaded data - cbcMaterials, err := encrypt.NewCBCSecureMaterials(symmetricKey) - if err != nil { - log.Fatalln(err) - } - - // Encrypt file content and upload to the server - n, err := s3Client.FPutEncryptedObject("my-bucketname", "my-objectname", filePath, cbcMaterials) - if err != nil { - log.Fatalln(err) - } - - log.Println("Uploaded", "my-objectname", " of size: ", n, "Successfully.") -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/fputobject-context.go b/vendor/github.com/minio/minio-go/examples/s3/fputobject-context.go deleted file mode 100644 index d7c941c2b..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/fputobject-context.go +++ /dev/null @@ -1,53 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - "time" - - "context" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname, my-objectname - // and my-filename.csv are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute) - defer cancel() - - if _, err := s3Client.FPutObjectWithContext(ctx, "my-bucketname", "my-objectname", "my-filename.csv", minio.PutObjectOptions{ContentType: "application/csv"}); err != nil { - log.Fatalln(err) - } - log.Println("Successfully uploaded my-filename.csv") -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/fputobject.go b/vendor/github.com/minio/minio-go/examples/s3/fputobject.go deleted file mode 100644 index 34d876804..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/fputobject.go +++ /dev/null @@ -1,48 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname, my-objectname - // and my-filename.csv are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - if _, err := s3Client.FPutObject("my-bucketname", "my-objectname", "my-filename.csv", minio.PutObjectOptions{ - ContentType: "application/csv", - }); err != nil { - log.Fatalln(err) - } - log.Println("Successfully uploaded my-filename.csv") -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/get-encrypted-object.go b/vendor/github.com/minio/minio-go/examples/s3/get-encrypted-object.go deleted file mode 100644 index 9783bebe8..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/get-encrypted-object.go +++ /dev/null @@ -1,89 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "io" - "log" - "os" - - "github.com/minio/minio-go" - "github.com/minio/minio-go/pkg/encrypt" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname, my-objectname and - // my-testfile are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESS-KEY-HERE", "YOUR-SECRET-KEY-HERE", true) - if err != nil { - log.Fatalln(err) - } - - //// Build an asymmetric key from private and public files - // - // privateKey, err := ioutil.ReadFile("private.key") - // if err != nil { - // t.Fatal(err) - // } - // - // publicKey, err := ioutil.ReadFile("public.key") - // if err != nil { - // t.Fatal(err) - // } - // - // asymmetricKey, err := NewAsymmetricKey(privateKey, publicKey) - // if err != nil { - // t.Fatal(err) - // } - //// - - // Build a symmetric key - symmetricKey := encrypt.NewSymmetricKey([]byte("my-secret-key-00")) - - // Build encryption materials which will encrypt uploaded data - cbcMaterials, err := encrypt.NewCBCSecureMaterials(symmetricKey) - if err != nil { - log.Fatalln(err) - } - - // Get a deciphered data from the server, deciphering is assured by cbcMaterials - reader, err := s3Client.GetEncryptedObject("my-bucketname", "my-objectname", cbcMaterials) - if err != nil { - log.Fatalln(err) - } - defer reader.Close() - - // Local file which holds plain data - localFile, err := os.Create("my-testfile") - if err != nil { - log.Fatalln(err) - } - defer localFile.Close() - - if _, err := io.Copy(localFile, reader); err != nil { - log.Fatalln(err) - } -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/getbucketnotification.go b/vendor/github.com/minio/minio-go/examples/s3/getbucketnotification.go deleted file mode 100644 index 19349baaf..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/getbucketnotification.go +++ /dev/null @@ -1,56 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are - // dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - // s3Client.TraceOn(os.Stderr) - - notifications, err := s3Client.GetBucketNotification("my-bucketname") - if err != nil { - log.Fatalln(err) - } - - log.Println("Bucket notification are successfully retrieved.") - - for _, topicConfig := range notifications.TopicConfigs { - for _, e := range topicConfig.Events { - log.Println(e + " event is enabled.") - } - } -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/getbucketpolicy.go b/vendor/github.com/minio/minio-go/examples/s3/getbucketpolicy.go deleted file mode 100644 index f9ac89b61..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/getbucketpolicy.go +++ /dev/null @@ -1,56 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are - // dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - // s3Client.TraceOn(os.Stderr) - - // Fetch the policy at 'my-objectprefix'. - policy, err := s3Client.GetBucketPolicy("my-bucketname", "my-objectprefix") - if err != nil { - log.Fatalln(err) - } - - // Description of policy output. - // "none" - The specified bucket does not have a bucket policy. - // "readonly" - Read only operations are allowed. - // "writeonly" - Write only operations are allowed. - // "readwrite" - both read and write operations are allowed, the bucket is public. - log.Println("Success - ", policy) -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/getobject-context.go b/vendor/github.com/minio/minio-go/examples/s3/getobject-context.go deleted file mode 100644 index c7d41707a..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/getobject-context.go +++ /dev/null @@ -1,73 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "io" - "log" - "os" - "time" - - "context" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname, my-objectname and - // my-testfile are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESS-KEY-HERE", "YOUR-SECRET-KEY-HERE", true) - if err != nil { - log.Fatalln(err) - } - - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute) - defer cancel() - - opts := minio.GetObjectOptions{} - opts.SetModified(time.Now().Round(10 * time.Minute)) // get object if was modified within the last 10 minutes - reader, err := s3Client.GetObjectWithContext(ctx, "my-bucketname", "my-objectname", opts) - if err != nil { - log.Fatalln(err) - } - defer reader.Close() - - localFile, err := os.Create("my-testfile") - if err != nil { - log.Fatalln(err) - } - defer localFile.Close() - - stat, err := reader.Stat() - if err != nil { - log.Fatalln(err) - } - - if _, err := io.CopyN(localFile, reader, stat.Size); err != nil { - log.Fatalln(err) - } -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/getobject.go b/vendor/github.com/minio/minio-go/examples/s3/getobject.go deleted file mode 100644 index e17ef8172..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/getobject.go +++ /dev/null @@ -1,64 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "io" - "log" - "os" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname, my-objectname and - // my-testfile are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESS-KEY-HERE", "YOUR-SECRET-KEY-HERE", true) - if err != nil { - log.Fatalln(err) - } - - reader, err := s3Client.GetObject("my-bucketname", "my-objectname", minio.GetObjectOptions{}) - if err != nil { - log.Fatalln(err) - } - defer reader.Close() - - localFile, err := os.Create("my-testfile") - if err != nil { - log.Fatalln(err) - } - defer localFile.Close() - - stat, err := reader.Stat() - if err != nil { - log.Fatalln(err) - } - - if _, err := io.CopyN(localFile, reader, stat.Size); err != nil { - log.Fatalln(err) - } -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/listbucketpolicies.go b/vendor/github.com/minio/minio-go/examples/s3/listbucketpolicies.go deleted file mode 100644 index 43edd0c3d..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/listbucketpolicies.go +++ /dev/null @@ -1,57 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are - // dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - // s3Client.TraceOn(os.Stderr) - - // Fetch the policy at 'my-objectprefix'. - policies, err := s3Client.ListBucketPolicies("my-bucketname", "my-objectprefix") - if err != nil { - log.Fatalln(err) - } - - // ListBucketPolicies returns a map of objects policy rules and their associated permissions - // e.g. mybucket/downloadfolder/* => readonly - // mybucket/shared/* => readwrite - - for resource, permission := range policies { - log.Println(resource, " => ", permission) - } -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/listbuckets.go b/vendor/github.com/minio/minio-go/examples/s3/listbuckets.go deleted file mode 100644 index 5eae587b4..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/listbuckets.go +++ /dev/null @@ -1,49 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID and YOUR-SECRETACCESSKEY are - // dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - buckets, err := s3Client.ListBuckets() - if err != nil { - log.Fatalln(err) - } - for _, bucket := range buckets { - log.Println(bucket) - } -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/listincompleteuploads.go b/vendor/github.com/minio/minio-go/examples/s3/listincompleteuploads.go deleted file mode 100644 index a5a79b603..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/listincompleteuploads.go +++ /dev/null @@ -1,58 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "fmt" - "log" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname and my-prefixname - // are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - // Create a done channel to control 'ListObjects' go routine. - doneCh := make(chan struct{}) - - // Indicate to our routine to exit cleanly upon return. - defer close(doneCh) - - // List all multipart uploads from a bucket-name with a matching prefix. - for multipartObject := range s3Client.ListIncompleteUploads("my-bucketname", "my-prefixname", true, doneCh) { - if multipartObject.Err != nil { - fmt.Println(multipartObject.Err) - return - } - fmt.Println(multipartObject) - } - return -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/listobjects-N.go b/vendor/github.com/minio/minio-go/examples/s3/listobjects-N.go deleted file mode 100644 index 55bceb470..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/listobjects-N.go +++ /dev/null @@ -1,77 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "fmt" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname and my-prefixname - // are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - fmt.Println(err) - return - } - - // List 'N' number of objects from a bucket-name with a matching prefix. - listObjectsN := func(bucket, prefix string, recursive bool, N int) (objsInfo []minio.ObjectInfo, err error) { - // Create a done channel to control 'ListObjects' go routine. - doneCh := make(chan struct{}, 1) - - // Free the channel upon return. - defer close(doneCh) - - i := 1 - for object := range s3Client.ListObjects(bucket, prefix, recursive, doneCh) { - if object.Err != nil { - return nil, object.Err - } - i++ - // Verify if we have printed N objects. - if i == N { - // Indicate ListObjects go-routine to exit and stop - // feeding the objectInfo channel. - doneCh <- struct{}{} - } - objsInfo = append(objsInfo, object) - } - return objsInfo, nil - } - - // List recursively first 100 entries for prefix 'my-prefixname'. - recursive := true - objsInfo, err := listObjectsN("my-bucketname", "my-prefixname", recursive, 100) - if err != nil { - fmt.Println(err) - } - - // Print all the entries. - fmt.Println(objsInfo) -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/listobjects.go b/vendor/github.com/minio/minio-go/examples/s3/listobjects.go deleted file mode 100644 index 1da2e3faa..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/listobjects.go +++ /dev/null @@ -1,58 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "fmt" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname and my-prefixname - // are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - fmt.Println(err) - return - } - - // Create a done channel to control 'ListObjects' go routine. - doneCh := make(chan struct{}) - - // Indicate to our routine to exit cleanly upon return. - defer close(doneCh) - - // List all objects from a bucket-name with a matching prefix. - for object := range s3Client.ListObjects("my-bucketname", "my-prefixname", true, doneCh) { - if object.Err != nil { - fmt.Println(object.Err) - return - } - fmt.Println(object) - } - return -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/listobjectsV2.go b/vendor/github.com/minio/minio-go/examples/s3/listobjectsV2.go deleted file mode 100644 index 190aec36b..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/listobjectsV2.go +++ /dev/null @@ -1,58 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "fmt" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname and my-prefixname - // are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - fmt.Println(err) - return - } - - // Create a done channel to control 'ListObjects' go routine. - doneCh := make(chan struct{}) - - // Indicate to our routine to exit cleanly upon return. - defer close(doneCh) - - // List all objects from a bucket-name with a matching prefix. - for object := range s3Client.ListObjectsV2("my-bucketname", "my-prefixname", true, doneCh) { - if object.Err != nil { - fmt.Println(object.Err) - return - } - fmt.Println(object) - } - return -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/makebucket.go b/vendor/github.com/minio/minio-go/examples/s3/makebucket.go deleted file mode 100644 index 419c96cf2..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/makebucket.go +++ /dev/null @@ -1,47 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are - // dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - err = s3Client.MakeBucket("my-bucketname", "us-east-1") - if err != nil { - log.Fatalln(err) - } - log.Println("Success") -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/presignedgetobject.go b/vendor/github.com/minio/minio-go/examples/s3/presignedgetobject.go deleted file mode 100644 index fd7fb9e8d..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/presignedgetobject.go +++ /dev/null @@ -1,54 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - "net/url" - "time" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname and my-objectname - // are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - // Set request parameters - reqParams := make(url.Values) - reqParams.Set("response-content-disposition", "attachment; filename=\"your-filename.txt\"") - - // Gernerate presigned get object url. - presignedURL, err := s3Client.PresignedGetObject("my-bucketname", "my-objectname", time.Duration(1000)*time.Second, reqParams) - if err != nil { - log.Fatalln(err) - } - log.Println(presignedURL) -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/presignedheadobject.go b/vendor/github.com/minio/minio-go/examples/s3/presignedheadobject.go deleted file mode 100644 index 8dbc0a4b7..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/presignedheadobject.go +++ /dev/null @@ -1,54 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - "net/url" - "time" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname and my-objectname - // are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - // Set request parameters - reqParams := make(url.Values) - reqParams.Set("response-content-disposition", "attachment; filename=\"your-filename.txt\"") - - // Gernerate presigned get object url. - presignedURL, err := s3Client.PresignedHeadObject("my-bucketname", "my-objectname", time.Duration(1000)*time.Second, reqParams) - if err != nil { - log.Fatalln(err) - } - log.Println(presignedURL) -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/presignedpostpolicy.go b/vendor/github.com/minio/minio-go/examples/s3/presignedpostpolicy.go deleted file mode 100644 index 205ac95a3..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/presignedpostpolicy.go +++ /dev/null @@ -1,60 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "fmt" - "log" - "time" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname and my-objectname - // are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - policy := minio.NewPostPolicy() - policy.SetBucket("my-bucketname") - policy.SetKey("my-objectname") - // Expires in 10 days. - policy.SetExpires(time.Now().UTC().AddDate(0, 0, 10)) - // Returns form data for POST form request. - url, formData, err := s3Client.PresignedPostPolicy(policy) - if err != nil { - log.Fatalln(err) - } - fmt.Printf("curl ") - for k, v := range formData { - fmt.Printf("-F %s=%s ", k, v) - } - fmt.Printf("-F file=@/etc/bash.bashrc ") - fmt.Printf("%s\n", url) -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/presignedputobject.go b/vendor/github.com/minio/minio-go/examples/s3/presignedputobject.go deleted file mode 100644 index b2f8b4f82..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/presignedputobject.go +++ /dev/null @@ -1,48 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - "time" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname and my-objectname - // are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - presignedURL, err := s3Client.PresignedPutObject("my-bucketname", "my-objectname", time.Duration(1000)*time.Second) - if err != nil { - log.Fatalln(err) - } - log.Println(presignedURL) -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/put-encrypted-object.go b/vendor/github.com/minio/minio-go/examples/s3/put-encrypted-object.go deleted file mode 100644 index cdf09ac53..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/put-encrypted-object.go +++ /dev/null @@ -1,85 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - "os" - - "github.com/minio/minio-go" - "github.com/minio/minio-go/pkg/encrypt" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-testfile, my-bucketname and - // my-objectname are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - // Open a local file that we will upload - file, err := os.Open("my-testfile") - if err != nil { - log.Fatalln(err) - } - defer file.Close() - - //// Build an asymmetric key from private and public files - // - // privateKey, err := ioutil.ReadFile("private.key") - // if err != nil { - // t.Fatal(err) - // } - // - // publicKey, err := ioutil.ReadFile("public.key") - // if err != nil { - // t.Fatal(err) - // } - // - // asymmetricKey, err := NewAsymmetricKey(privateKey, publicKey) - // if err != nil { - // t.Fatal(err) - // } - //// - - // Build a symmetric key - symmetricKey := encrypt.NewSymmetricKey([]byte("my-secret-key-00")) - - // Build encryption materials which will encrypt uploaded data - cbcMaterials, err := encrypt.NewCBCSecureMaterials(symmetricKey) - if err != nil { - log.Fatalln(err) - } - - // Encrypt file content and upload to the server - n, err := s3Client.PutEncryptedObject("my-bucketname", "my-objectname", file, cbcMaterials) - if err != nil { - log.Fatalln(err) - } - - log.Println("Uploaded", "my-objectname", " of size: ", n, "Successfully.") -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/putobject-context.go b/vendor/github.com/minio/minio-go/examples/s3/putobject-context.go deleted file mode 100644 index acc923f7e..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/putobject-context.go +++ /dev/null @@ -1,68 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - "os" - "time" - - "context" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-testfile, my-bucketname and - // my-objectname are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute) - defer cancel() - - object, err := os.Open("my-testfile") - if err != nil { - log.Fatalln(err) - } - defer object.Close() - - objectStat, err := object.Stat() - if err != nil { - log.Fatalln(err) - } - - n, err := s3Client.PutObjectWithContext(ctx, "my-bucketname", "my-objectname", object, objectStat.Size(), minio.PutObjectOptions{ - ContentType: "application/octet-stream", - }) - if err != nil { - log.Fatalln(err) - } - log.Println("Uploaded", "my-objectname", " of size: ", n, "Successfully.") -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/putobject-getobject-sse.go b/vendor/github.com/minio/minio-go/examples/s3/putobject-getobject-sse.go deleted file mode 100644 index 3d3b2fd2d..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/putobject-getobject-sse.go +++ /dev/null @@ -1,87 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "bytes" - "crypto/md5" - "encoding/base64" - "io/ioutil" - "log" - - minio "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-testfile, my-bucketname and - // my-objectname are dummy values, please replace them with original values. - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - minioClient, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - content := bytes.NewReader([]byte("Hello again")) - key := []byte("32byteslongsecretkeymustprovided") - h := md5.New() - h.Write(key) - encryptionKey := base64.StdEncoding.EncodeToString(key) - encryptionKeyMD5 := base64.StdEncoding.EncodeToString(h.Sum(nil)) - - // Amazon S3 does not store the encryption key you provide. - // Instead S3 stores a randomly salted HMAC value of the - // encryption key in order to validate future requests. - // The salted HMAC value cannot be used to derive the value - // of the encryption key or to decrypt the contents of the - // encrypted object. That means, if you lose the encryption - // key, you lose the object. - var metadata = map[string]string{ - "x-amz-server-side-encryption-customer-algorithm": "AES256", - "x-amz-server-side-encryption-customer-key": encryptionKey, - "x-amz-server-side-encryption-customer-key-MD5": encryptionKeyMD5, - } - - // minioClient.TraceOn(os.Stderr) // Enable to debug. - _, err = minioClient.PutObject("mybucket", "my-encrypted-object.txt", content, 11, minio.PutObjectOptions{UserMetadata: metadata}) - if err != nil { - log.Fatalln(err) - } - - opts := minio.GetObjectOptions{} - for k, v := range metadata { - opts.Set(k, v) - } - coreClient := minio.Core{minioClient} - reader, _, err := coreClient.GetObject("mybucket", "my-encrypted-object.txt", opts) - if err != nil { - log.Fatalln(err) - } - defer reader.Close() - - decBytes, err := ioutil.ReadAll(reader) - if err != nil { - log.Fatalln(err) - } - if !bytes.Equal(decBytes, []byte("Hello again")) { - log.Fatalln("Expected \"Hello, world\", got %s", string(decBytes)) - } -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/putobject-progress.go b/vendor/github.com/minio/minio-go/examples/s3/putobject-progress.go deleted file mode 100644 index 0e92dd65e..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/putobject-progress.go +++ /dev/null @@ -1,64 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - - "github.com/cheggaaa/pb" - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-testfile, my-bucketname and - // my-objectname are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - reader, err := s3Client.GetObject("my-bucketname", "my-objectname", minio.GetObjectOptions{}) - if err != nil { - log.Fatalln(err) - } - defer reader.Close() - - objectInfo, err := reader.Stat() - if err != nil { - log.Fatalln(err) - } - - // Progress reader is notified as PutObject makes progress with - // the Reads inside. - progress := pb.New64(objectInfo.Size) - progress.Start() - n, err := s3Client.PutObject("my-bucketname", "my-objectname-progress", reader, objectInfo.Size, minio.PutObjectOptions{ContentType: "application/octet-stream", Progress: progress}) - - if err != nil { - log.Fatalln(err) - } - log.Println("Uploaded", "my-objectname", " of size: ", n, "Successfully.") -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/putobject-s3-accelerate.go b/vendor/github.com/minio/minio-go/examples/s3/putobject-s3-accelerate.go deleted file mode 100644 index 06345cd87..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/putobject-s3-accelerate.go +++ /dev/null @@ -1,62 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - "os" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-testfile, my-bucketname and - // my-objectname are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - // Enable S3 transfer accelerate endpoint. - s3Client.SetS3TransferAccelerate("s3-accelerate.amazonaws.com") - - object, err := os.Open("my-testfile") - if err != nil { - log.Fatalln(err) - } - defer object.Close() - - objectStat, err := object.Stat() - if err != nil { - log.Fatalln(err) - } - - n, err := s3Client.PutObject("my-bucketname", "my-objectname", object, objectStat.Size(), minio.PutObjectOptions{ContentType: "application/octet-stream"}) - if err != nil { - log.Fatalln(err) - } - log.Println("Uploaded", "my-objectname", " of size: ", n, "Successfully.") -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/putobject-streaming.go b/vendor/github.com/minio/minio-go/examples/s3/putobject-streaming.go deleted file mode 100644 index 85b78dd45..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/putobject-streaming.go +++ /dev/null @@ -1,55 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - "os" - - minio "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-testfile, my-bucketname and - // my-objectname are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - object, err := os.Open("my-testfile") - if err != nil { - log.Fatalln(err) - } - defer object.Close() - - n, err := s3Client.PutObject("my-bucketname", "my-objectname", object, -1, minio.PutObjectOptions{}) - if err != nil { - log.Fatalln(err) - } - - log.Println("Uploaded", "my-objectname", " of size: ", n, "Successfully.") -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/putobject.go b/vendor/github.com/minio/minio-go/examples/s3/putobject.go deleted file mode 100644 index b9e4ff16c..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/putobject.go +++ /dev/null @@ -1,58 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - "os" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-testfile, my-bucketname and - // my-objectname are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - object, err := os.Open("my-testfile") - if err != nil { - log.Fatalln(err) - } - defer object.Close() - objectStat, err := object.Stat() - if err != nil { - log.Fatalln(err) - } - - n, err := s3Client.PutObject("my-bucketname", "my-objectname", object, objectStat.Size(), minio.PutObjectOptions{ContentType: "application/octet-stream"}) - if err != nil { - log.Fatalln(err) - } - log.Println("Uploaded", "my-objectname", " of size: ", n, "Successfully.") -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/removeallbucketnotification.go b/vendor/github.com/minio/minio-go/examples/s3/removeallbucketnotification.go deleted file mode 100644 index 1186afad8..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/removeallbucketnotification.go +++ /dev/null @@ -1,50 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are - // dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - // s3Client.TraceOn(os.Stderr) - - err = s3Client.RemoveAllBucketNotification("my-bucketname") - if err != nil { - log.Fatalln(err) - } - - log.Println("Bucket notification are successfully removed.") -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/removebucket.go b/vendor/github.com/minio/minio-go/examples/s3/removebucket.go deleted file mode 100644 index 7a7737ee0..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/removebucket.go +++ /dev/null @@ -1,49 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are - // dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - // This operation will only work if your bucket is empty. - err = s3Client.RemoveBucket("my-bucketname") - if err != nil { - log.Fatalln(err) - } - log.Println("Success") - -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/removeincompleteupload.go b/vendor/github.com/minio/minio-go/examples/s3/removeincompleteupload.go deleted file mode 100644 index 31cc8790b..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/removeincompleteupload.go +++ /dev/null @@ -1,47 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname and my-objectname - // are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - err = s3Client.RemoveIncompleteUpload("my-bucketname", "my-objectname") - if err != nil { - log.Fatalln(err) - } - log.Println("Success") -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/removeobject.go b/vendor/github.com/minio/minio-go/examples/s3/removeobject.go deleted file mode 100644 index 7e5848576..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/removeobject.go +++ /dev/null @@ -1,46 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname and my-objectname - // are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - err = s3Client.RemoveObject("my-bucketname", "my-objectname") - if err != nil { - log.Fatalln(err) - } - log.Println("Success") -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/removeobjects.go b/vendor/github.com/minio/minio-go/examples/s3/removeobjects.go deleted file mode 100644 index b912bc85d..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/removeobjects.go +++ /dev/null @@ -1,65 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname and my-objectname - // are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - objectsCh := make(chan string) - - // Send object names that are needed to be removed to objectsCh - go func() { - defer close(objectsCh) - // List all objects from a bucket-name with a matching prefix. - for object := range s3Client.ListObjects("my-bucketname", "my-prefixname", true, doneCh) { - if object.Err != nil { - log.Fatalln(object.Err) - } - objectsCh <- object.Key - } - }() - - // Call RemoveObjects API - errorCh := s3Client.RemoveObjects("my-bucketname", objectsCh) - - // Print errors received from RemoveObjects API - for e := range errorCh { - log.Fatalln("Failed to remove " + e.ObjectName + ", error: " + e.Err.Error()) - } - - log.Println("Success") -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/setbucketnotification.go b/vendor/github.com/minio/minio-go/examples/s3/setbucketnotification.go deleted file mode 100644 index b5af30f06..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/setbucketnotification.go +++ /dev/null @@ -1,86 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are - // dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - // s3Client.TraceOn(os.Stderr) - - // ARN represents a notification channel that needs to be created in your S3 provider - // (e.g. http://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html) - - // An example of an ARN: - // arn:aws:sns:us-east-1:804064459714:UploadPhoto - // ^ ^ ^ ^ ^ - // Provider __| | | | | - // | Region Account ID |_ Notification Name - // Service _| - // - // You should replace YOUR-PROVIDER, YOUR-SERVICE, YOUR-REGION, YOUR-ACCOUNT-ID and YOUR-RESOURCE - // with actual values that you receive from the S3 provider - - // Here you create a new Topic notification - topicArn := minio.NewArn("YOUR-PROVIDER", "YOUR-SERVICE", "YOUR-REGION", "YOUR-ACCOUNT-ID", "YOUR-RESOURCE") - topicConfig := minio.NewNotificationConfig(topicArn) - topicConfig.AddEvents(minio.ObjectCreatedAll, minio.ObjectRemovedAll) - topicConfig.AddFilterPrefix("photos/") - topicConfig.AddFilterSuffix(".jpg") - - // Create a new Queue notification - queueArn := minio.NewArn("YOUR-PROVIDER", "YOUR-SERVICE", "YOUR-REGION", "YOUR-ACCOUNT-ID", "YOUR-RESOURCE") - queueConfig := minio.NewNotificationConfig(queueArn) - queueConfig.AddEvents(minio.ObjectRemovedAll) - - // Create a new Lambda (CloudFunction) - lambdaArn := minio.NewArn("YOUR-PROVIDER", "YOUR-SERVICE", "YOUR-REGION", "YOUR-ACCOUNT-ID", "YOUR-RESOURCE") - lambdaConfig := minio.NewNotificationConfig(lambdaArn) - lambdaConfig.AddEvents(minio.ObjectRemovedAll) - lambdaConfig.AddFilterSuffix(".swp") - - // Now, set all previously created notification configs - bucketNotification := minio.BucketNotification{} - bucketNotification.AddTopic(topicConfig) - bucketNotification.AddQueue(queueConfig) - bucketNotification.AddLambda(lambdaConfig) - - err = s3Client.SetBucketNotification("YOUR-BUCKET", bucketNotification) - if err != nil { - log.Fatalln("Error: " + err.Error()) - } - log.Println("Success") -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/setbucketpolicy.go b/vendor/github.com/minio/minio-go/examples/s3/setbucketpolicy.go deleted file mode 100644 index c81fb5050..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/setbucketpolicy.go +++ /dev/null @@ -1,55 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - - "github.com/minio/minio-go" - "github.com/minio/minio-go/pkg/policy" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are - // dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - - // s3Client.TraceOn(os.Stderr) - - // Description of policy input. - // policy.BucketPolicyNone - Remove any previously applied bucket policy at a prefix. - // policy.BucketPolicyReadOnly - Set read-only operations at a prefix. - // policy.BucketPolicyWriteOnly - Set write-only operations at a prefix. - // policy.BucketPolicyReadWrite - Set read-write operations at a prefix. - err = s3Client.SetBucketPolicy("my-bucketname", "my-objectprefix", policy.BucketPolicyReadWrite) - if err != nil { - log.Fatalln(err) - } - log.Println("Success") -} diff --git a/vendor/github.com/minio/minio-go/examples/s3/statobject.go b/vendor/github.com/minio/minio-go/examples/s3/statobject.go deleted file mode 100644 index 0b27a83b3..000000000 --- a/vendor/github.com/minio/minio-go/examples/s3/statobject.go +++ /dev/null @@ -1,46 +0,0 @@ -// +build ignore - -/* - * Minio Go Library for Amazon S3 Compatible Cloud Storage - * Copyright 2015-2017 Minio, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "log" - - "github.com/minio/minio-go" -) - -func main() { - // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY, my-bucketname and my-objectname - // are dummy values, please replace them with original values. - - // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. - // This boolean value is the last argument for New(). - - // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically - // determined based on the Endpoint value. - s3Client, err := minio.New("s3.amazonaws.com", "YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", true) - if err != nil { - log.Fatalln(err) - } - stat, err := s3Client.StatObject("my-bucketname", "my-objectname", minio.StatObjectOptions{}) - if err != nil { - log.Fatalln(err) - } - log.Println(stat) -} -- cgit v1.2.3-1-g7c22