github.com/macb/etcd@v0.3.1-0.20140227003422-a60481c6b1a0/server/v1/delete_key_handler.go (about)

     1  package v1
     2  
     3  import (
     4  	"github.com/coreos/etcd/third_party/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  }