mirror of
				https://github.com/etcd-io/etcd.git
				synced 2024-09-27 06:25:44 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			346 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			346 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package v2
 | |
| 
 | |
| import (
 | |
| 	"net/http"
 | |
| 
 | |
| 	"github.com/gorilla/mux"
 | |
| )
 | |
| 
 | |
| func DeleteHandler(w http.ResponseWriter, req *http.Request, s Server) error {
 | |
| 	vars := mux.Vars(req)
 | |
| 	key := "/" + vars["key"]
 | |
| 	recursive := (req.FormValue("recursive") == "true")
 | |
| 
 | |
| 	c := s.Store().CommandFactory().CreateDeleteCommand(key, recursive)
 | |
| 	return s.Dispatch(c, w, req)
 | |
| }
 | 
