64 Commits

Author SHA1 Message Date
Xiang Li
aab41f06d0 elog: remove elog 2014-09-25 11:33:10 -07:00
Jonathan Boulle
2da1010cf7 etcdhttp: make TTL= equivalent to unset, and TTL=0 expire 2014-09-24 17:41:44 -07:00
Jonathan Boulle
fa762e6b25 etcdhttp: process dir parameter in request 2014-09-24 17:11:28 -07:00
Jonathan Boulle
2b52384e7e etcdhttp: allow empty values for TTL parameter 2014-09-24 16:44:55 -07:00
Jonathan Boulle
2e2cd12407 etcdhttp: disallow empty prevValue fields 2014-09-24 15:21:18 -07:00
Jonathan Boulle
a9caa24f8a etcdhttp: add test for streaming watches 2014-09-24 11:27:36 -07:00
Jonathan Boulle
ddc30c0a33 etcdserver: use Context to communicate timeout, and add tests 2014-09-24 11:27:36 -07:00
Jonathan Boulle
172a32e5e3 etcdserver: correct timeout and streaming handling
This reintroduces the 'stream' parameter to support long-lived watch
sessions. These sessions respect a server timeout (set to 5 minutes by
default).
2014-09-24 11:27:36 -07:00
Jonathan Boulle
b85ad9bbc2 Merge pull request #1082 from jonboulle/1082_x_etcd_index
X-Etcd-Index returns the node's modifiedIndex
2014-09-23 15:14:21 -07:00
Brian Waldon
99e9f561ee etcdserver: add Peers.Addrs 2014-09-23 10:56:41 -07:00
Brian Waldon
10220335f7 etcdserver: determine scheme based on TLSClientConfig 2014-09-23 10:14:12 -07:00
Brian Waldon
e19b0442f8 etcdserver: pass scheme into send 2014-09-23 10:14:11 -07:00
Brian Waldon
fb7968d704 etcdserver: Peers.Pick returns just an addr 2014-09-23 10:09:34 -07:00
Brian Waldon
5470a6d3d6 etcdserver: pass http client into Sender 2014-09-23 10:02:23 -07:00
Jonathan Boulle
5441c6aa54 etcdserver: correct X-Etcd-Index header
This adds an EtcdIndex field to store.Event and uses that as the header
instead of the node's modifiedIndex. To facilitate this in a non-racy
way, we set the EtcdIndex while holding the lock.
2014-09-22 18:56:12 -07:00
Brian Waldon
91003cb994 *: s/prevExists/prevExist/ 2014-09-18 21:25:08 -07:00
Yicheng Qin
f786de13d0 Merge pull request #1081 from unihorn/125
make TTL work
2014-09-16 15:14:44 -07:00
Yicheng Qin
023dc7cba2 etcdserver: add SYNC request 2014-09-16 13:42:03 -07:00
Jonathan Boulle
67e57ffca4 etcdserver: split out client and server listeners 2014-09-16 11:36:37 -07:00
Jonathan Boulle
30b70e18c5 etcdserver/etcdhttp: add simple test for peers send 2014-09-15 21:10:00 -07:00
Jonathan Boulle
a7ec09c877 etcdserver/etcdhttp: use empty node for test 2014-09-15 20:34:14 -07:00
Jonathan Boulle
f846c5286a etcdserver/etcdhttp: fix comment, simplify resServer 2014-09-15 19:01:40 -07:00
Jonathan Boulle
27cf7747ea etcdserver/etcdhttp: add tests for serveKeys 2014-09-15 18:33:10 -07:00
Jonathan Boulle
7ac3b32de6 etcdserver: change raft endpoint to send StatusNoContent 2014-09-15 16:10:31 -07:00
Jonathan Boulle
3e2c160eed etcdserver/etcdhttp: add test coverage for serveRaft 2014-09-15 16:07:06 -07:00
Jonathan Boulle
e04c028d64 etcdserver/etcdhttp: switch to using http.ServeMux 2014-09-15 16:05:20 -07:00
Jonathan Boulle
8a5ab2ec06 etcdserver: introduce Server interface
This changes etcdserver.Server to an interface, with the former Server
(now "EtcdServer") becoming the canonical/production implementation.
This will facilitate better testing of the http server et al with mock
implementations of the interface.
It also more clearly defines the boundary for users of the Server.
2014-09-15 15:11:01 -07:00
Jonathan Boulle
d9cfc35bed etcdhttp: check method for every endpoint, add tests 2014-09-15 14:56:43 -07:00
Jonathan Boulle
20776f1947 etcdserver: use int64slice directly 2014-09-11 19:17:07 -07:00
Jonathan Boulle
e18b8c12be etcdserver: switch to proper int64Slice for sorting 2014-09-11 17:28:08 -07:00
Jonathan Boulle
5f66b35852 etcdserver/etcdhttp: split out peers and add tests 2014-09-11 16:53:55 -07:00
Jonathan Boulle
c03798f99b Merge pull request #1011 from jonboulle/clean_http
Validate HTTP API user input
2014-09-11 15:31:25 -07:00
Jonathan Boulle
786982d8e5 simplify 2014-09-11 15:13:56 -07:00
Jonathan Boulle
52ddd389ff etcdhttp: use Form values over query parameters 2014-09-11 15:12:31 -07:00
Jonathan Boulle
7c03704b19 etcdserver: restructure to hopefully simplify
Obviate parseBool helper, define emptyReq locally to parseRequest,
have writeEvent return an error which gets logged
2014-09-11 08:50:41 -07:00
Brian Waldon
bafe960dba etcdhttp: add Peers.Endpoints 2014-09-10 18:02:02 -07:00
Brian Waldon
c251304068 *: s/Id/ID/
golang convention dictates that the individual characters in an
abbreviation should all have the same case. Use ID instead of Id.

The protobuf generator still generates code that does not meet
this convention, but that's a fight for another day.
2014-09-10 16:09:08 -07:00
Jonathan Boulle
e2d01eff35 etcdserver: switch to using etcd.Error 2014-09-10 15:46:13 -07:00
Jonathan Boulle
2342402434 etcdserver: address style comments 2014-09-10 14:14:14 -07:00
Jonathan Boulle
bed63cddf7 etcdhttp: add tests for ParseBool/ParseUint64 helpers 2014-09-10 12:05:36 -07:00
Jonathan Boulle
e736a11ac4 etcdhttp: perform validation of query parameters
Add basic input validation of all query parameters supported by
serveKeys. Also restructures etcdhttp a bit to better facilitate
testing.

Test coverage is slightly improved.
2014-09-10 12:01:58 -07:00
Yicheng Qin
51e4bbfeb0 http: check err return from http.NewRequest 2014-09-09 20:46:56 -07:00
Yicheng Qin
01871e7c29 http: use sort.Strings 2014-09-09 16:20:02 -07:00
Yicheng Qin
d519491545 http: add TODO for peers var 2014-09-09 15:55:42 -07:00
Yicheng Qin
961a61d708 http: add allow func
For further extendability
2014-09-09 15:45:34 -07:00
Yicheng Qin
4087fa5c7a http: allow GET, HEAD for /v2/machines 2014-09-09 15:22:52 -07:00
Yicheng Qin
0c1d1b7aeb etcdhttp: add /v2/machines endpoint 2014-09-09 15:00:29 -07:00
Jonathan Boulle
44acd57ea4 etcdserver: remove superfluous context 2014-09-09 11:18:25 -07:00
Jonathan Boulle
07ce8bc4bc etcdserver: split out functional test to new package 2014-09-09 11:18:24 -07:00
Jonathan Boulle
8473f3bf52 api: address review comments 2014-09-09 11:17:53 -07:00