mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 18:10:59 +00:00
rename to tools directory
This commit is contained in:
19
internal/tools/httpclient/httpclient.go
Normal file
19
internal/tools/httpclient/httpclient.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package httpclient
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gomodule/redigo/redis"
|
||||
"github.com/gregjones/httpcache"
|
||||
redis_cache "github.com/gregjones/httpcache/redis"
|
||||
)
|
||||
|
||||
func NewClient(conn redis.Conn) *http.Client {
|
||||
etagCache := redis_cache.NewWithClient(conn)
|
||||
tr := httpcache.NewTransport(etagCache)
|
||||
return &http.Client{
|
||||
Transport: tr,
|
||||
Timeout: 10 * time.Second,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user