etcd/server/v1/delete_key_handler.go
2013-10-11 01:02:38 -06:00

16 lines
324 B
Go

package v1
import (
"encoding/json"
"github.com/coreos/etcd/store"
"net/http"
)
// Removes a key from the store.
func DeleteKeyHandler(w http.ResponseWriter, req *http.Request, s Server) error {
vars := mux.Vars(req)
key := "/" + vars["key"]
command := &DeleteCommand{Key: key}
return s.Dispatch(command, w, req)
}