3414: adding PullHandler and Replicator
authorTim Pierce <twp@curoverse.com>
Fri, 22 Aug 2014 15:12:53 +0000 (11:12 -0400)
committerTim Pierce <twp@curoverse.com>
Tue, 26 Aug 2014 19:17:22 +0000 (15:17 -0400)
commitb185fc94a543b5b1361497c8502e876d6fdc2838
treed15bdcbea844b5b2322bfbc1edc82cbe54c07710
parent6e39e6e9ce10895a5405c90a0b61290ab507d16d
3414: adding PullHandler and Replicator

Added PullHandler and a "replicator" package to handle "PUT /pull" requests.

PUT /pull requests are routed to PullHandler, which authenticates the
request and validates the JSON in the request body. Valid requests are
sent to the replicator.

The Keepstore replicator runs a goroutine which repeatedly listens on
its input channel for a new pull list.

TestPullHandler tests each combination of: request from superuser;
request from ordinary user; properly formatted pull request; improperly
formatted pull request.  It checks the state of the replicator when done
to make sure that it has the expected number of pull requests.

3414: add replicator.
services/keepstore/handler_test.go
services/keepstore/handlers.go
services/keepstore/keepstore.go
services/keepstore/replicator/replica.go [new file with mode: 0644]