-
Notifications
You must be signed in to change notification settings - Fork 41
Comparing S3 packages #11
Description
A surface level comparison of:
- https://godoc.org/gopkg.in/amz.v1/s3
- https://godoc.org/github.com/mitchellh/goamz/s3
- https://godoc.org/github.com/crowdmob/goamz/s3
- https://godoc.org/github.com/goamz/goamz/s3
mitchellh/goamz/s3
mitchellh/goamz/s3 doesn't have func RetryAttempts(retry bool) but there are several added methods:
func (b *Bucket) Copy(oldPath, newPath string, perm ACL) error
func (b *Bucket) GetBucketContents() (*map[string]Key, error)
func (b *Bucket) GetKey(path string) (*Key, error)
func (b *Bucket) GetResponse(path string) (*http.Response, error)
func (b *Bucket) GetTorrent(path string) ([]byte, error)
func (b *Bucket) GetTorrentReader(path string) (io.ReadCloser, error)
func (b *Bucket) Head(path string) (*http.Response, error)
func (b *Bucket) MultiDel(paths []string) error
func (b *Bucket) PutHeader(path string, data []byte, customHeaders map[string][]string, perm ACL) error
func (b *Bucket) PutReaderHeader(path string, r io.Reader, length int64, customHeaders map[string][]string, perm ACL) error
func (s3 *S3) ListBuckets() (result *ListBucketsResp, err error)
crowdmob/goamz/s3
crowdmob/goamz/s3 has added some of the same methods as mitchellh/goamz/s3
func (b *Bucket) GetResponse(path string) (resp *http.Response, err error)
and others, but with a different method signature:
func (b *Bucket) Head(path string, headers map[string][]string) (*http.Response, error)
it has also changed some of the amz.v1 methods to take an Options struct:
func (b *Bucket) InitMulti(key string, contType string, perm ACL, options Options) (*Multi, error)
func (b *Bucket) Put(path string, data []byte, contType string, perm ACL, options Options) error
func (b *Bucket) PutReader(path string, r io.Reader, length int64, contType string, perm ACL, options Options) error
and then added a whole slough of new methods, some that sound like they accomplish the same things as mitchellh/goamz/s3, but in a different way:
func (b *Bucket) DelMulti(objects Delete) error
func (b *Bucket) DeleteLifecycleConfiguration() error
func (b *Bucket) Exists(path string) (exists bool, err error)
func (b *Bucket) GetLifecycleConfiguration() (*LifecycleConfiguration, error)
func (b *Bucket) GetResponseWithHeaders(path string, headers map[string][]string) (resp *http.Response, err error)
func (b *Bucket) Location() (string, error)
func (b *Bucket) PostFormArgs(path string, expires time.Time, redirect string) (action string, fields map[string]string)
func (b *Bucket) PostFormArgsEx(path string, expires time.Time, redirect string, conds []string) (action string, fields map[string]string)
func (b *Bucket) PutBucketSubresource(subresource string, r io.Reader, length int64) error
func (b *Bucket) PutBucketWebsite(configuration WebsiteConfiguration) error
func (b *Bucket) PutCopy(path string, perm ACL, options CopyOptions, source string) (*CopyObjectResult, error)
func (b *Bucket) PutLifecycleConfiguration(c *LifecycleConfiguration) error
func (b *Bucket) SignedURLWithArgs(path string, expires time.Time, params url.Values, headers http.Header) string
func (b *Bucket) UploadSignedURL(path, method, content_type string, expires time.Time) string
func (b *Bucket) Versions(prefix, delim, keyMarker string, versionIdMarker string, max int) (result *VersionsResp, err error)
# ... and a whole lot more (those are just under bucket)
goamz/goamz/s3 looks pretty similar to crowdmob/goamz/s3.
This isn't to say all these methods should be added. But it does mean I can't take even a trivial project that was using mitchellh/goamz/s3 and recompile it with amz.v1/s3. Handy methods like GetBucketContents and MultiDel don't exist.
As another point of comparison, there is Stripe's generated API:
http://godoc.org/github.com/stripe/aws-go/gen/s3
Note: I can't currently refer to http://godoc.org/gopkg.in/amz.v2-dev/s3 for comparison.