delete_handler.go 340 B

12345678910111213141516
  1. package v2
  2. import (
  3. "net/http"
  4. "github.com/gorilla/mux"
  5. )
  6. func DeleteHandler(w http.ResponseWriter, req *http.Request, s Server) error {
  7. vars := mux.Vars(req)
  8. key := vars["key"]
  9. recursive := (req.FormValue("recursive") == "true")
  10. c := s.Store().CommandFactory().CreateDeleteCommand(key, recursive)
  11. return s.Dispatch(c, w, req)
  12. }