changed some json tag names to Lower Camel Case to be consistent with the rest

This commit is contained in:
Travis 2017-04-19 13:36:58 -05:00
parent 25e649add8
commit dcaf7617de
No known key found for this signature in database
GPG key ID: 7F08008DFD9314C9
4 changed files with 10 additions and 10 deletions

View file

@ -20,7 +20,7 @@ const (
// Node represents a node in the cluster.
type Node struct {
Host string `json:"host"`
InternalHost string `json:"internal_host"`
InternalHost string `json:"internalHost"`
}
// Nodes represents a list of nodes.

View file

@ -27,7 +27,7 @@ type ImportCommand struct {
Paths []string `json:"paths"`
// Size of buffer used to chunk import.
BufferSize int `json:"buffer-size"`
BufferSize int `json:"bufferSize"`
// Reusable client.
Client *pilosa.Client `json:"-"`

View file

@ -214,7 +214,7 @@ func (h *Handler) handleGetSliceMax(w http.ResponseWriter, r *http.Request) {
}
type sliceMaxResponse struct {
MaxSlices map[string]uint64 `json:"MaxSlices"`
MaxSlices map[string]uint64 `json:"maxSlices"`
}
// handleGetDBs handles GET /db request.
@ -391,7 +391,7 @@ func (h *Handler) handlePatchDBTimeQuantum(w http.ResponseWriter, r *http.Reques
}
type patchDBTimeQuantumRequest struct {
TimeQuantum string `json:"time_quantum"`
TimeQuantum string `json:"timeQuantum"`
}
type patchDBTimeQuantumResponse struct{}
@ -611,7 +611,7 @@ func (h *Handler) handlePatchFrameTimeQuantum(w http.ResponseWriter, r *http.Req
}
type patchFrameTimeQuantumRequest struct {
TimeQuantum string `json:"time_quantum"`
TimeQuantum string `json:"timeQuantum"`
}
type patchFrameTimeQuantumResponse struct{}

View file

@ -83,7 +83,7 @@ func TestHandler_MaxSlices(t *testing.T) {
h.ServeHTTP(w, MustNewHTTPRequest("GET", "/slices/max", nil))
if w.Code != http.StatusOK {
t.Fatalf("unexpected status code: %d", w.Code)
} else if body := w.Body.String(); body != `{"MaxSlices":{"d0":3,"d1":0}}`+"\n" {
} else if body := w.Body.String(); body != `{"maxSlices":{"d0":3,"d1":0}}`+"\n" {
t.Fatalf("unexpected body: %s", body)
}
}
@ -123,7 +123,7 @@ func TestHandler_MaxSlices_Inverse(t *testing.T) {
h.ServeHTTP(w, MustNewHTTPRequest("GET", "/slices/max?inverse=true", nil))
if w.Code != http.StatusOK {
t.Fatalf("unexpected status code: %d", w.Code)
} else if body := w.Body.String(); body != `{"MaxSlices":{"d0":3,"d1":0}}`+"\n" {
} else if body := w.Body.String(); body != `{"maxSlices":{"d0":3,"d1":0}}`+"\n" {
t.Fatalf("unexpected body: %s", body)
}
}
@ -556,7 +556,7 @@ func TestHandler_SetDBTimeQuantum(t *testing.T) {
h := NewHandler()
h.Index = idx.Index
w := httptest.NewRecorder()
h.ServeHTTP(w, MustNewHTTPRequest("PATCH", "/db/d0/time-quantum", strings.NewReader(`{"time_quantum":"ymdh"}`)))
h.ServeHTTP(w, MustNewHTTPRequest("PATCH", "/db/d0/time-quantum", strings.NewReader(`{"timeQuantum":"ymdh"}`)))
if w.Code != http.StatusOK {
t.Fatalf("unexpected status code: %d", w.Code)
} else if body := w.Body.String(); body != `{}`+"\n" {
@ -579,7 +579,7 @@ func TestHandler_SetFrameTimeQuantum(t *testing.T) {
h := NewHandler()
h.Index = idx.Index
w := httptest.NewRecorder()
h.ServeHTTP(w, MustNewHTTPRequest("PATCH", "/db/d0/frame/f1/time-quantum", strings.NewReader(`{"time_quantum":"ymdh"}`)))
h.ServeHTTP(w, MustNewHTTPRequest("PATCH", "/db/d0/frame/f1/time-quantum", strings.NewReader(`{"timeQuantum":"ymdh"}`)))
if w.Code != http.StatusOK {
t.Fatalf("unexpected status code: %d", w.Code)
} else if body := w.Body.String(); body != `{}`+"\n" {
@ -763,7 +763,7 @@ func TestHandler_Fragment_Nodes(t *testing.T) {
h.ServeHTTP(w, r)
if w.Code != http.StatusOK {
t.Fatalf("unexpected status code: %d", w.Code)
} else if w.Body.String() != `[{"host":"host1","internal_host":""},{"host":"host2","internal_host":""}]`+"\n" {
} else if w.Body.String() != `[{"host":"host1","internalHost":""},{"host":"host2","internalHost":""}]`+"\n" {
t.Fatalf("unexpected body: %q", w.Body.String())
}
}