mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: add docs
This commit is contained in:
parent
2a212c9016
commit
ba7d174349
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user