mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-25 21:06:24 +02:00
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:
parent
ec96fcbc90
commit
11370ac826
19 changed files with 1228 additions and 0 deletions
28
vendor/github.com/sqs/s3/client.go
generated
vendored
Normal file
28
vendor/github.com/sqs/s3/client.go
generated
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
package s3
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/kr/http/transport"
|
||||
)
|
||||
|
||||
// Client returns an HTTP client that signs all outgoing requests.
|
||||
// The returned Transport also provides CancelRequest.
|
||||
// Client is equivalent to DefaultService.Client.
|
||||
func Client(k Keys) *http.Client {
|
||||
return DefaultService.Client(k)
|
||||
}
|
||||
|
||||
// Client returns an HTTP client that signs all outgoing requests.
|
||||
// The returned Transport also provides CancelRequest.
|
||||
func (s *Service) Client(k Keys) *http.Client {
|
||||
tr := &transport.Wrapper{Modify: func(r *http.Request) error {
|
||||
if r.Header.Get("Date") == "" {
|
||||
r.Header.Set("Date", time.Now().UTC().Format(http.TimeFormat))
|
||||
}
|
||||
s.Sign(r, k)
|
||||
return nil
|
||||
}}
|
||||
return &http.Client{Transport: tr}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue