feat(util/http_client): Adds generic HTTP client

Supports retries with exponential backoff as well as connection
timeouts and the ability to skip SSL/TLS verification.

This commit also refactors datasource and initialize packages
in order to use the new HTTP client.
This commit is contained in:
Camilo Aguilar
2014-05-21 13:13:20 -04:00
parent 5fa2ad8dfd
commit 3e00a37ef5
7 changed files with 154 additions and 122 deletions

View File

@@ -5,6 +5,8 @@ import (
"io/ioutil"
"log"
"strings"
"github.com/coreos/coreos-cloudinit/util"
)
const (
@@ -29,7 +31,8 @@ func (self *procCmdline) Fetch() ([]byte, error) {
return nil, err
}
cfg, err := fetchURL(url)
client := util.NewHttpClient()
cfg, err := client.Get(url)
if err != nil {
return nil, err
}