3e00a37ef5
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.
21 lines
390 B
Go
21 lines
390 B
Go
package datasource
|
|
|
|
import "github.com/coreos/coreos-cloudinit/util"
|
|
|
|
type metadataService struct {
|
|
url string
|
|
}
|
|
|
|
func NewMetadataService(url string) *metadataService {
|
|
return &metadataService{url}
|
|
}
|
|
|
|
func (ms *metadataService) Fetch() ([]byte, error) {
|
|
client := util.NewHttpClient()
|
|
return client.Get(ms.url)
|
|
}
|
|
|
|
func (ms *metadataService) Type() string {
|
|
return "metadata-service"
|
|
}
|