Update readme and docstrings, minor refactors.

This commit is contained in:
Rohan Verma
2018-12-24 17:31:36 +05:30
parent d218b23f05
commit e4c7d93da1
4 changed files with 150 additions and 30 deletions
+19 -1
View File
@@ -49,7 +49,7 @@ func TestS3_GeneratePresignedURL_Personal(t *testing.T) {
})
}
func TestS3_GeneratePresignedURL_POST(t *testing.T) {
func TestS3_GeneratePresignedURL_PUT(t *testing.T) {
t.Run("Test", func(t *testing.T) {
s := New(
os.Getenv("AWS_S3_REGION"),
@@ -68,3 +68,21 @@ func TestS3_GeneratePresignedURL_POST(t *testing.T) {
}
})
}
func BenchmarkS3_GeneratePresigned(b *testing.B) {
// run the Fib function b.N times
s := New(
os.Getenv("AWS_S3_REGION"),
os.Getenv("AWS_S3_ACCESS_KEY"),
os.Getenv("AWS_S3_SECRET_KEY"),
)
for n := 0; n < b.N; n++ {
s.GeneratePresignedURL(PresignedInput{
Bucket: os.Getenv("AWS_S3_BUCKET"),
ObjectKey: "test.txt",
Method: "GET",
Timestamp: NowTime(),
ExpirySeconds: 3600,
})
}
}