1
0
Fork 0

Further changes after service changed

master
Philip O'Toole 8 years ago
parent 829adc138e
commit d02b7e93bf

@ -8,12 +8,9 @@ import (
"fmt"
"io/ioutil"
"net/http"
"runtime"
)
// Nodes represents a set of nodes currently registered at the configured Discovery URL.
type Nodes []string
// DiscoResponse represents the response returned by a Discovery Service.
type DiscoResponse struct {
CreatedAt string `json:"created_at"`
DiscoID string `json:"disco_id"`
@ -41,9 +38,7 @@ func (c *Client) URL() string {
// address.
func (c *Client) Register(id, addr string) (*DiscoResponse, error) {
m := map[string]string{
"addr": addr,
"GOOS": runtime.GOOS,
"GOARCH": runtime.GOARCH,
"addr": addr,
}
b, err := json.Marshal(m)
if err != nil {

@ -6,7 +6,6 @@ import (
"io/ioutil"
"net/http"
"net/http/httptest"
"runtime"
"testing"
)
@ -92,12 +91,6 @@ func Test_ClientRegisterRequestOK(t *testing.T) {
if m["addr"] != "http://127.0.0.1" {
t.Fatalf("incorrect join address supplied by client: %s", m["addr"])
}
if m["GOOS"] != runtime.GOOS {
t.Fatalf("incorrect GOOS supplied by client: %s", m["GOOS"])
}
if m["GOARCH"] != runtime.GOARCH {
t.Fatalf("incorrect GOOS supplied by client: %s", m["GOARCH"])
}
fmt.Fprintln(w, `{"created_at": "2017-02-17 04:49:05.079125", "disco_id": "68d6c7cc-f4cc-11e6-a170-2e79ea0be7b1", "nodes": ["http://127.0.0.1"]}`)
}))

Loading…
Cancel
Save