cloudinit/datasource/metadata_service.go
Camilo Aguilar 3e00a37ef5 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.
2014-05-21 13:31:50 -04:00

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"
}