vendor: add sourcegraph/s3cache and dependencies

Adds:
 - github.com/kr/http/transport
 - github.com/sqs/s3
 - github.com/sqs/s3/s3util
 - sourcegraph.com/sourcegraph/s3cache
This commit is contained in:
Will Norris 2015-12-07 20:04:55 -08:00
parent ec96fcbc90
commit 11370ac826
19 changed files with 1228 additions and 0 deletions

32
vendor/github.com/sqs/s3/s3util/delete.go generated vendored Normal file
View file

@ -0,0 +1,32 @@
package s3util
import (
"io"
"net/http"
"time"
)
// Delete deletes the S3 object at url. An HTTP status other than 204 (No
// Content) is considered an error.
//
// If c is nil, Delete uses DefaultConfig.
func Delete(url string, c *Config) (io.ReadCloser, error) {
if c == nil {
c = DefaultConfig
}
r, _ := http.NewRequest("DELETE", url, nil)
r.Header.Set("Date", time.Now().UTC().Format(http.TimeFormat))
c.Sign(r, *c.Keys)
client := c.Client
if client == nil {
client = http.DefaultClient
}
resp, err := client.Do(r)
if err != nil {
return nil, err
}
if resp.StatusCode != http.StatusNoContent {
return nil, newRespError(resp)
}
return resp.Body, nil
}