github.com/kula/etcd@v0.2.1-0.20131226070625-e96234382ac0/server/v1/delete_key_handler.go (about)

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