Commit Graph

11 Commits

Author SHA1 Message Date
Frank Schroeder eddb1af603 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 ee5b06a231 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 c248b0017a 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 0101ee38eb agent: Fixing blocking queries on internal endpoints 2015-02-18 15:15:02 -08:00
Armon Dadgar d1213d4e17 agent: Summarize node level checks as well 2014-04-30 23:44:29 -04:00
Armon Dadgar 416ff8f7d6 agent: Adding UI services endpoint 2014-04-30 23:43:59 -04:00
Armon Dadgar acf67a1630 agent: Adding node UI endpoint 2014-04-30 23:43:59 -04:00
Armon Dadgar fbce850317 agent: Adding nodes UI endpoint 2014-04-30 23:43:59 -04:00
Armon Dadgar 1a4cb628f5 agent: Simplify serving of ui files 2014-04-30 23:43:57 -04:00
Armon Dadgar f0c9ba4c01 agent: Improving UI file serving 2014-04-30 23:43:56 -04:00
Armon Dadgar e20b70b9f6 agent: Adding endpoint to serve the UI 2014-04-30 23:43:56 -04:00