diff --git a/Gopkg.lock b/Gopkg.lock index 1a1c421..e6fa468 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -46,8 +46,8 @@ [[projects]] name = "github.com/minio/minio-go" packages = [".","pkg/credentials","pkg/encrypt","pkg/policy","pkg/s3signer","pkg/s3utils","pkg/set"] - revision = "4e0f567303d4cc90ceb055a451959fb9fc391fb9" - version = "3.0.3" + revision = "57a8ae886b49af6eb0d2c27c2d007ed2f71e1da5" + version = "4.0.3" [[projects]] name = "github.com/pkg/errors" @@ -88,6 +88,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "418c94e2d7594bbe1cca1b2014f3bcdf31271c8b6d3c757c25564619d3eccd0a" + inputs-digest = "5ab967c9abb8839deef83bb16468854f4bc3cf22123dbae72157241ccb6eb49a" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 374059e..8e02153 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -23,7 +23,7 @@ [[constraint]] name = "github.com/gorilla/mux" - version = "1.5.0" + version = "1.6.0" [[constraint]] branch = "master" @@ -31,7 +31,7 @@ [[constraint]] name = "github.com/minio/minio-go" - version = "3.0.3" + version = "4.0.3" [[constraint]] name = "github.com/pkg/errors" diff --git a/create_object.go b/create_object.go index dd6f279..cae5483 100644 --- a/create_object.go +++ b/create_object.go @@ -5,6 +5,7 @@ import ( "net/http" "github.com/gorilla/mux" + minio "github.com/minio/minio-go" "github.com/pkg/errors" ) @@ -30,7 +31,7 @@ func CreateObjectHandler(s3 S3) http.Handler { }() bucketName := mux.Vars(r)["bucketName"] - _, err = s3.PutObject(bucketName, handler.Filename, file, contentTypeOctetStream) + _, err = s3.PutObject(bucketName, handler.Filename, file, 1, minio.PutObjectOptions{ContentType: contentTypeOctetStream}) if err != nil { handleHTTPError(w, errors.Wrap(err, "error putting object")) return diff --git a/get_object.go b/get_object.go index 95a7539..d59f346 100644 --- a/get_object.go +++ b/get_object.go @@ -6,6 +6,7 @@ import ( "net/http" "github.com/gorilla/mux" + minio "github.com/minio/minio-go" "github.com/pkg/errors" ) @@ -16,7 +17,7 @@ func GetObjectHandler(s3 S3) http.Handler { bucketName := vars["bucketName"] objectName := vars["objectName"] - object, err := s3.GetObject(bucketName, objectName) + object, err := s3.GetObject(bucketName, objectName, minio.GetObjectOptions{}) if err != nil { handleHTTPError(w, errors.Wrap(err, "error getting object")) return diff --git a/s3.go b/s3.go index ccffcab..d0588e2 100644 --- a/s3.go +++ b/s3.go @@ -9,11 +9,11 @@ import ( // S3 is a client to interact with S3 storage. type S3 interface { CopyObject(minio.DestinationInfo, minio.SourceInfo) error - GetObject(string, string) (*minio.Object, error) + GetObject(string, string, minio.GetObjectOptions) (*minio.Object, error) ListBuckets() ([]minio.BucketInfo, error) ListObjectsV2(string, string, bool, <-chan struct{}) <-chan minio.ObjectInfo MakeBucket(string, string) error - PutObject(string, string, io.Reader, string) (int64, error) + PutObject(string, string, io.Reader, int64, minio.PutObjectOptions) (int64, error) RemoveBucket(string) error RemoveObject(string, string) error } diff --git a/s3_test.go b/s3_test.go index 8cca192..442a09a 100644 --- a/s3_test.go +++ b/s3_test.go @@ -20,7 +20,7 @@ func (s *s3Mock) CopyObject(minio.DestinationInfo, minio.SourceInfo) error { } // GetObject mocks minio.Client.GetObject. -func (s *s3Mock) GetObject(bucketName string, objectName string) (*minio.Object, error) { +func (s *s3Mock) GetObject(bucketName string, objectName string, opts minio.GetObjectOptions) (*minio.Object, error) { if s.Err != nil { return nil, s.Err } @@ -73,7 +73,7 @@ func (s *s3Mock) MakeBucket(string, string) error { } // PutObject mocks minio.Client.PutObject. -func (s *s3Mock) PutObject(string, string, io.Reader, string) (int64, error) { +func (s *s3Mock) PutObject(string, string, io.Reader, int64, minio.PutObjectOptions) (int64, error) { return 0, s.Err }