delete_key_handler.go 392 B

1234567891011121314151617181920
  1. package v2
  2. import (
  3. "net/http"
  4. "github.com/coreos/etcd/store"
  5. "github.com/gorilla/mux"
  6. )
  7. func DeleteKeyHandler(w http.ResponseWriter, req *http.Request, s Server) error {
  8. vars := mux.Vars(req)
  9. key := "/" + vars["key"]
  10. c := &store.DeleteCommand{
  11. Key: key,
  12. Recursive: (req.FormValue("recursive") == "true"),
  13. }
  14. return s.Dispatch(c, w, req)
  15. }