cloudinit/datasource/metadata_service.go

29 lines
549 B
Go
Raw Normal View History

2014-03-18 20:00:41 +04:00
package datasource
2014-03-05 04:36:05 +04:00
import "github.com/coreos/coreos-cloudinit/pkg"
2014-03-05 04:36:05 +04:00
type metadataService struct {
url string
2014-03-05 04:36:05 +04:00
}
2014-03-05 05:06:52 +04:00
func NewMetadataService(url string) *metadataService {
return &metadataService{url}
2014-03-05 04:36:05 +04:00
}
func (self *metadataService) ConfigRoot() string {
return ""
}
func (self *metadataService) FetchMetadata() ([]byte, error) {
return []byte{}, nil
}
func (ms *metadataService) FetchUserdata() ([]byte, error) {
client := pkg.NewHttpClient()
return client.Get(ms.url)
2014-03-05 04:36:05 +04:00
}
2014-03-18 20:00:41 +04:00
func (ms *metadataService) Type() string {
return "metadata-service"
}