21 lines
		
	
	
		
			393 B
		
	
	
	
		
			Smarty
		
	
	
	
	
	
		
		
			
		
	
	
			21 lines
		
	
	
		
			393 B
		
	
	
	
		
			Smarty
		
	
	
	
	
	
|  | 
 | ||
|  | package middleware
 | ||
|  | 
 | ||
|  | import "net/http"
 | ||
|  | 
 | ||
|  | type {{.name}} struct { | ||
|  | }
 | ||
|  | 
 | ||
|  | func New{{.name}}() *{{.name}} {	 | ||
|  | 	return &{{.name}}{}
 | ||
|  | }
 | ||
|  | 
 | ||
|  | func (m *{{.name}})Handle(next http.HandlerFunc) http.HandlerFunc { | ||
|  | 	return func(w http.ResponseWriter, r *http.Request) { | ||
|  | 		// TODO generate middleware implement function, delete after code implementation
 | ||
|  | 
 | ||
|  | 		// Passthrough to next handler if need 
 | ||
|  | 		next(w, r)
 | ||
|  | 	}	
 | ||
|  | }
 |