github.com/matm/etcd@v0.3.1-0.20140328024009-5b4a473f1453/server/v1/delete_key_handler.go (about)

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