delete_key_handler.go 327 B

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