style(util->httpbackoff): Changes package as per @philips suggestion
This commit is contained in:
parent
3e00a37ef5
commit
2cedebb4eb
@ -1,6 +1,6 @@
|
|||||||
package datasource
|
package datasource
|
||||||
|
|
||||||
import "github.com/coreos/coreos-cloudinit/util"
|
import "github.com/coreos/coreos-cloudinit/httpbackoff"
|
||||||
|
|
||||||
type metadataService struct {
|
type metadataService struct {
|
||||||
url string
|
url string
|
||||||
@ -11,7 +11,7 @@ func NewMetadataService(url string) *metadataService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (ms *metadataService) Fetch() ([]byte, error) {
|
func (ms *metadataService) Fetch() ([]byte, error) {
|
||||||
client := util.NewHttpClient()
|
client := httpbackoff.NewHttpClient()
|
||||||
return client.Get(ms.url)
|
return client.Get(ms.url)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/coreos/coreos-cloudinit/util"
|
"github.com/coreos/coreos-cloudinit/httpbackoff"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -31,7 +31,7 @@ func (self *procCmdline) Fetch() ([]byte, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
client := util.NewHttpClient()
|
client := httpbackoff.NewHttpClient()
|
||||||
cfg, err := client.Get(url)
|
cfg, err := client.Get(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package util
|
package httpbackoff
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/tls"
|
"crypto/tls"
|
@ -1,4 +1,4 @@
|
|||||||
package util
|
package httpbackoff
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
@ -4,8 +4,8 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/coreos/coreos-cloudinit/httpbackoff"
|
||||||
"github.com/coreos/coreos-cloudinit/system"
|
"github.com/coreos/coreos-cloudinit/system"
|
||||||
"github.com/coreos/coreos-cloudinit/util"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type UserKey struct {
|
type UserKey struct {
|
||||||
@ -24,7 +24,7 @@ func SSHImportKeysFromURL(system_user string, url string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func fetchUserKeys(url string) ([]string, error) {
|
func fetchUserKeys(url string) ([]string, error) {
|
||||||
client := util.NewHttpClient()
|
client := httpbackoff.NewHttpClient()
|
||||||
data, err := client.Get(url)
|
data, err := client.Get(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
2
test
2
test
@ -13,7 +13,7 @@ COVER=${COVER:-"-cover"}
|
|||||||
|
|
||||||
source ./build
|
source ./build
|
||||||
|
|
||||||
declare -a TESTPKGS=(initialize system datasource util)
|
declare -a TESTPKGS=(initialize system datasource httpbackoff)
|
||||||
|
|
||||||
if [ -z "$PKG" ]; then
|
if [ -z "$PKG" ]; then
|
||||||
GOFMTPATH="$TESTPKGS coreos-cloudinit.go"
|
GOFMTPATH="$TESTPKGS coreos-cloudinit.go"
|
||||||
|
Loading…
Reference in New Issue
Block a user