From 2cedebb4eb0dae459122227a4663bd2793592291 Mon Sep 17 00:00:00 2001 From: Camilo Aguilar Date: Wed, 21 May 2014 21:12:16 -0400 Subject: [PATCH] style(util->httpbackoff): Changes package as per @philips suggestion --- datasource/metadata_service.go | 4 ++-- datasource/proc_cmdline.go | 4 ++-- {util => httpbackoff}/http_client.go | 2 +- {util => httpbackoff}/http_client_test.go | 2 +- initialize/ssh_keys.go | 4 ++-- test | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) rename {util => httpbackoff}/http_client.go (99%) rename {util => httpbackoff}/http_client_test.go (99%) diff --git a/datasource/metadata_service.go b/datasource/metadata_service.go index 6fe1c59..032150e 100644 --- a/datasource/metadata_service.go +++ b/datasource/metadata_service.go @@ -1,6 +1,6 @@ package datasource -import "github.com/coreos/coreos-cloudinit/util" +import "github.com/coreos/coreos-cloudinit/httpbackoff" type metadataService struct { url string @@ -11,7 +11,7 @@ func NewMetadataService(url string) *metadataService { } func (ms *metadataService) Fetch() ([]byte, error) { - client := util.NewHttpClient() + client := httpbackoff.NewHttpClient() return client.Get(ms.url) } diff --git a/datasource/proc_cmdline.go b/datasource/proc_cmdline.go index c14d43f..716eb9b 100644 --- a/datasource/proc_cmdline.go +++ b/datasource/proc_cmdline.go @@ -6,7 +6,7 @@ import ( "log" "strings" - "github.com/coreos/coreos-cloudinit/util" + "github.com/coreos/coreos-cloudinit/httpbackoff" ) const ( @@ -31,7 +31,7 @@ func (self *procCmdline) Fetch() ([]byte, error) { return nil, err } - client := util.NewHttpClient() + client := httpbackoff.NewHttpClient() cfg, err := client.Get(url) if err != nil { return nil, err diff --git a/util/http_client.go b/httpbackoff/http_client.go similarity index 99% rename from util/http_client.go rename to httpbackoff/http_client.go index 1c9ec70..6d2465a 100644 --- a/util/http_client.go +++ b/httpbackoff/http_client.go @@ -1,4 +1,4 @@ -package util +package httpbackoff import ( "crypto/tls" diff --git a/util/http_client_test.go b/httpbackoff/http_client_test.go similarity index 99% rename from util/http_client_test.go rename to httpbackoff/http_client_test.go index 5243407..a0ca82e 100644 --- a/util/http_client_test.go +++ b/httpbackoff/http_client_test.go @@ -1,4 +1,4 @@ -package util +package httpbackoff import ( "fmt" diff --git a/initialize/ssh_keys.go b/initialize/ssh_keys.go index 7059c24..5c92e2a 100644 --- a/initialize/ssh_keys.go +++ b/initialize/ssh_keys.go @@ -4,8 +4,8 @@ import ( "encoding/json" "fmt" + "github.com/coreos/coreos-cloudinit/httpbackoff" "github.com/coreos/coreos-cloudinit/system" - "github.com/coreos/coreos-cloudinit/util" ) type UserKey struct { @@ -24,7 +24,7 @@ func SSHImportKeysFromURL(system_user string, url string) error { } func fetchUserKeys(url string) ([]string, error) { - client := util.NewHttpClient() + client := httpbackoff.NewHttpClient() data, err := client.Get(url) if err != nil { return nil, err diff --git a/test b/test index 41abb37..73875c7 100755 --- a/test +++ b/test @@ -13,7 +13,7 @@ COVER=${COVER:-"-cover"} source ./build -declare -a TESTPKGS=(initialize system datasource util) +declare -a TESTPKGS=(initialize system datasource httpbackoff) if [ -z "$PKG" ]; then GOFMTPATH="$TESTPKGS coreos-cloudinit.go"