delete_key_handler.go 366 B

123456789101112131415
  1. package v1
  2. import (
  3. "net/http"
  4. "github.com/coreos/etcd/third_party/github.com/gorilla/mux"
  5. )
  6. // Removes a key from the store.
  7. func DeleteKeyHandler(w http.ResponseWriter, req *http.Request, s Server) error {
  8. vars := mux.Vars(req)
  9. key := "/" + vars["key"]
  10. c := s.Store().CommandFactory().CreateDeleteCommand(key, false, false)
  11. return s.Dispatch(c, w, req)
  12. }