-
Notifications
You must be signed in to change notification settings - Fork 657
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
api: Add NewWithCredentials() (#646)
This PR adds a new API - NewWithCredentials() Internally NewWithCredentials is now used with all APIs such as New(), NewV4(), NewV2() and NewWithRegion. Also brings a new package called `credentials` to manage various credentials type, currently the credentials package supports - Reading file from `.aws/credentials`, `.mc/config.json` - Reading env variables for AWS*, MINIO* - Fetching from IAM roles assigned to an EC2 instance. - Static credentials which is the current default behavior. Example code using IAM. ```go iam := credentials.NewIAM("") s3Client, err := minio.NewWithCredentials("s3.amazonaws.com", iam, true, "") if err != nil { log.Fatalln(err) } buckets, err := s3Client.ListBuckets() if err != nil { log.Fatalln(err) } for _, bucket := range buckets { log.Println(bucket) } ``` Fixes #643
- Loading branch information
1 parent
2f03aba
commit 5d7ee33
Showing
37 changed files
with
2,125 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.