diff --git a/s3/public.go b/s3/public.go index c4e4c93d..6fec215e 100644 --- a/s3/public.go +++ b/s3/public.go @@ -23,6 +23,7 @@ var ( _ aptly.PublishedStorage = (*PublishedStorage)(nil) ) +// NewPublishedStorageRaw creates published storage from raw aws credentials func NewPublishedStorageRaw(auth aws.Auth, region aws.Region, bucket, defaultACL, prefix string) (*PublishedStorage, error) { if defaultACL == "" { defaultACL = "private" @@ -163,14 +164,14 @@ func (storage *PublishedStorage) Filelist(prefix string) ([]string, error) { if err != nil { return nil, err } - last_key := "" + lastKey := "" for _, key := range contents.Contents { if prefix == "" { result = append(result, key.Key) } else { result = append(result, key.Key[len(prefix):]) } - last_key = key.Key + lastKey = key.Key } if contents.IsTruncated { marker = contents.NextMarker @@ -179,7 +180,7 @@ func (storage *PublishedStorage) Filelist(prefix string) ([]string, error) { // NextMarker and it is truncated, you can use the value of the // last Key in the response as the marker in the subsequent // request to get the next set of object keys. - marker = last_key + marker = lastKey } } else { break diff --git a/s3/public_test.go b/s3/public_test.go index f47567da..6b24891e 100644 --- a/s3/public_test.go +++ b/s3/public_test.go @@ -9,8 +9,8 @@ import ( ) type PublishedStorageSuite struct { - srv *s3test.Server - storage, prefixed_storage *PublishedStorage + srv *s3test.Server + storage, prefixedStorage *PublishedStorage } var _ = Suite(&PublishedStorageSuite{}) @@ -25,7 +25,7 @@ func (s *PublishedStorageSuite) SetUpTest(c *C) { s.storage, err = NewPublishedStorageRaw(auth, aws.Region{Name: "test-1", S3Endpoint: s.srv.URL(), S3LocationConstraint: true}, "test", "", "") c.Assert(err, IsNil) - s.prefixed_storage, err = NewPublishedStorageRaw(auth, aws.Region{Name: "test-1", S3Endpoint: s.srv.URL(), S3LocationConstraint: true}, "test", "", "lala") + s.prefixedStorage, err = NewPublishedStorageRaw(auth, aws.Region{Name: "test-1", S3Endpoint: s.srv.URL(), S3LocationConstraint: true}, "test", "", "lala") c.Assert(err, IsNil) err = s.storage.s3.Bucket("test").PutBucket("private") @@ -54,7 +54,7 @@ func (s *PublishedStorageSuite) TestPutFile(c *C) { c.Check(err, IsNil) c.Check(data, DeepEquals, []byte("welcome to s3!")) - err = s.prefixed_storage.PutFile("a/b.txt", filepath.Join(dir, "a")) + err = s.prefixedStorage.PutFile("a/b.txt", filepath.Join(dir, "a")) c.Check(err, IsNil) data, err = s.storage.bucket.Get("lala/a/b.txt") @@ -81,7 +81,7 @@ func (s *PublishedStorageSuite) TestFilelist(c *C) { c.Check(err, IsNil) c.Check(list, DeepEquals, []string{}) - list, err = s.prefixed_storage.Filelist("") + list, err = s.prefixedStorage.Filelist("") c.Check(err, IsNil) c.Check(list, DeepEquals, []string{"a", "b", "c"}) } diff --git a/s3/s3.go b/s3/s3.go index 801a026a..ddbb96f8 100644 --- a/s3/s3.go +++ b/s3/s3.go @@ -1,2 +1,2 @@ -// Package files handles publishing to S3 +// Package s3 handles publishing to Amazon S3 package s3