delete_key_handler.go 317 B

1234567891011121314
  1. package v1
  2. import (
  3. "github.com/gorilla/mux"
  4. "net/http"
  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)
  11. return s.Dispatch(c, w, req)
  12. }