etcdserver: add docs

This commit is contained in:
Blake Mizerany 2014-08-29 16:32:31 -07:00 committed by Yicheng Qin
parent 2a212c9016
commit ba7d174349

View File

@ -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")