Commit Graph

16 Commits

Author SHA1 Message Date
Frank Schroeder 84d6ac2d51 api: Return empty list instead of nil 2017-04-28 15:00:08 -07:00
Frank Schroeder 8bb7792799 golint: Drop the unused value from range
for i, _ := range foo -> for i := range foo
2017-04-25 09:26:13 -07:00
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
Kyle Havlovitz 5acd69b4fc
Add node metadata filtering to remaining health/catalog endpoints 2017-01-13 20:08:43 -05:00
James Phillips c0ff412650
Factors translate out into a separate file and makes safe for in-memory RPCs. 2016-08-15 15:05:02 -07:00
David van Geest cdeff022dd
Translate Address to tagged WAN address in HTTP API when appropriate. 2016-08-12 18:25:36 -07:00
Sean Chittenden e63d3a1275 Update Check API to use constants
Use constants where appropriate to advocate their use.  Also add a deprecation notice re: `updateTTL`.
2016-04-23 16:01: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
James Phillips 9caa5b3653 Adds distance sorting to health endpoint. Cleans up unit tests. 2015-10-23 15:23:01 -07:00
Armon Dadgar 135c409573 agent: Fixing passing filter. Fixes #241 2014-07-05 09:49:21 -07:00
Armon Dadgar 81a0a56fac agent: Support server-side filtering of passing checks. Fixes #57. 2014-04-21 16:08:26 -07:00
Armon Dadgar 386d60f8b2 agent: Remove wrapQuery, call setMeta directly 2014-04-21 12:40:11 -07:00
Armon Dadgar 09ddc01d27 agent: Updating to remove BlockingQuery 2014-04-21 12:25:36 -07:00
Armon Dadgar c58c53f448 agent: RPC changes and blocking query support 2014-02-05 14:36:13 -08:00
Armon Dadgar 779bc3b50b First pass at health endpoints 2014-01-10 15:13:37 -08:00