mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-06 00:25:55 +00:00
Cleanup and update comments
This commit is contained in:
parent
c1ca299904
commit
39c9d1ab25
1 changed files with 7 additions and 8 deletions
|
|
@ -9,20 +9,20 @@ import (
|
|||
"github.com/aws/aws-sdk-go/service/s3"
|
||||
)
|
||||
|
||||
type Uploader interface {
|
||||
Write(p []byte) (n int, err error)
|
||||
}
|
||||
|
||||
// NewS3Uploader creates an S3Uploader with a hardcoded region and bucket,
|
||||
// and a specified key.
|
||||
func NewS3Uploader(key string) *S3Uploader {
|
||||
region := "us-east-1"
|
||||
bucket := "benchmarks-pilosa"
|
||||
return &S3Uploader{
|
||||
region,
|
||||
"benchmarks-pilosa",
|
||||
bucket,
|
||||
s3.New(session.New(&aws.Config{Region: aws.String(region)})),
|
||||
key,
|
||||
}
|
||||
}
|
||||
|
||||
// S3Uploader is an io.Writer for sending output to AWS S3 storage.
|
||||
type S3Uploader struct {
|
||||
region string
|
||||
bucket string
|
||||
|
|
@ -30,10 +30,9 @@ type S3Uploader struct {
|
|||
key string
|
||||
}
|
||||
|
||||
// pilosa-sandbox is "us-east-1"
|
||||
// benchmarks go to benchmarks-pilosa/run-uuid/??.txt
|
||||
// first return value of PutObject contains an ETag (hash) of the uploaded object, returned here but not needed
|
||||
// Write writes data to the uploader's bucket/key
|
||||
func (u *S3Uploader) Write(data []byte) (int, error) {
|
||||
// first return value of PutObject contains an ETag (hash) of the uploaded object, not needed here
|
||||
fmt.Println(string(data))
|
||||
_, err := u.service.PutObject(&s3.PutObjectInput{
|
||||
Body: strings.NewReader(string(data)),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue