From ba7d174349dab30a9273d8f94b5acff2c374351f Mon Sep 17 00:00:00 2001 From: Blake Mizerany Date: Fri, 29 Aug 2014 16:32:31 -0700 Subject: [PATCH] etcdserver: add docs --- etcdserver2/server.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/etcdserver2/server.go b/etcdserver2/server.go index 5cf5f477c..01bda360a 100644 --- a/etcdserver2/server.go +++ b/etcdserver2/server.go @@ -88,10 +88,16 @@ func (s *Server) run() { } } +// Stop stops the server, and shutsdown the running goroutine. Stop should be +// called after a Start(s), otherwise it will block forever. func (s *Server) Stop() { s.done <- struct{}{} } +// Do interprets r and performs an operation on s.Store according to r.Method +// and other fields. If r.Method is "PUT", "PUT", or "DELETE, r will be sent +// through consensus before performing its respective operation. Do will block +// until an action is performed or there is an error. func (s *Server) Do(ctx context.Context, r pb.Request) (Response, error) { if r.Id == 0 { panic("r.Id cannot be 0")