Commit Graph

11 Commits

Author SHA1 Message Date
Frank Schroeder 9f8f258d4d Remove duplicate constants
This patch removes duplicate internal copies of constants in the structs
package which are also defined in the api package. The api.KVOp type
with all its values for the TXN endpoint and the api.HealthXXX constants
are now used throughout the codebase.

This resulted in some circular dependencies in the testutil package
which have been resolved by copying code and constants and moving the
WaitForLeader function into a separate testrpc package.
2017-04-20 09:54:49 -07:00
Frank Schroeder 58c3b1ff38 Use fmt.Fprint/Fprintf/Fprintln
Used the following rewrite rules:

gofmt -w -r 'resp.Write([]byte(fmt.Sprintf(a, b, c, d))) -> fmt.Fprintf(resp, a, b, c, d)' *.go
gofmt -w -r 'resp.Write([]byte(fmt.Sprintf(a, b, c))) -> fmt.Fprintf(resp, a, b, c)' *.go
gofmt -w -r 'resp.Write([]byte(fmt.Sprintf(a, b))) -> fmt.Fprintf(resp, a, b)'  *.go
gofmt -w -r 'resp.Write([]byte(fmt.Sprintf(a))) -> fmt.Fprint(resp, a)' *.go
gofmt -w -r 'resp.Write([]byte(a + "\n")) -> fmt.Fprintln(resp, a)' *.go
gofmt -w -r 'resp.Write([]byte(a)) -> fmt.Fprint(resp, a)' *.go
2017-04-20 09:02:59 -07:00
James Phillips 763d5ea8a7 Fixes nil slices from HTTP endpoints.
These would manifest in the HTTP output as Javascript nulls instead of
empty lists, so we had unintentionally changed the interface while
porting to the new state store. We added code to each HTTP endpoint to
convert nil slices to empty ones so they JSON-ify properly, and we added
tests to catch this in the future.
2015-11-14 21:05:37 -08:00
Armon Dadgar aadec620ff agent: Fixing blocking queries on internal endpoints 2015-02-18 15:15:02 -08:00
Armon Dadgar 9f2e236cf8 agent: Summarize node level checks as well 2014-04-30 23:44:29 -04:00
Armon Dadgar d1648871ea agent: Adding UI services endpoint 2014-04-30 23:43:59 -04:00
Armon Dadgar 250b8f2247 agent: Adding node UI endpoint 2014-04-30 23:43:59 -04:00
Armon Dadgar c794dac7b1 agent: Adding nodes UI endpoint 2014-04-30 23:43:59 -04:00
Armon Dadgar ba69350cef agent: Simplify serving of ui files 2014-04-30 23:43:57 -04:00
Armon Dadgar 6f833a5a73 agent: Improving UI file serving 2014-04-30 23:43:56 -04:00
Armon Dadgar 4983f66e75 agent: Adding endpoint to serve the UI 2014-04-30 23:43:56 -04:00