|  |  |  | @@ -23,7 +23,7 @@ type ( | 
		
	
		
			
				|  |  |  |  | 		Request() *http.Request | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// SetRequest sets `*http.Request`. | 
		
	
		
			
				|  |  |  |  | 		SetRequest(*http.Request) | 
		
	
		
			
				|  |  |  |  | 		SetRequest(r *http.Request) | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// Request returns `*Response`. | 
		
	
		
			
				|  |  |  |  | 		Response() *Response | 
		
	
	
		
			
				
					
					|  |  |  | @@ -42,25 +42,25 @@ type ( | 
		
	
		
			
				|  |  |  |  | 		Path() string | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// SetPath sets the registered path for the handler. | 
		
	
		
			
				|  |  |  |  | 		SetPath(string) | 
		
	
		
			
				|  |  |  |  | 		SetPath(p string) | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// Param returns path parameter by name. | 
		
	
		
			
				|  |  |  |  | 		Param(string) string | 
		
	
		
			
				|  |  |  |  | 		Param(name string) string | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// ParamNames returns path parameter names. | 
		
	
		
			
				|  |  |  |  | 		ParamNames() []string | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// SetParamNames sets path parameter names. | 
		
	
		
			
				|  |  |  |  | 		SetParamNames(...string) | 
		
	
		
			
				|  |  |  |  | 		SetParamNames(names ...string) | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// ParamValues returns path parameter values. | 
		
	
		
			
				|  |  |  |  | 		ParamValues() []string | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// SetParamValues sets path parameter values. | 
		
	
		
			
				|  |  |  |  | 		SetParamValues(...string) | 
		
	
		
			
				|  |  |  |  | 		SetParamValues(values ...string) | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// QueryParam returns the query param for the provided name. | 
		
	
		
			
				|  |  |  |  | 		QueryParam(string) string | 
		
	
		
			
				|  |  |  |  | 		QueryParam(name string) string | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// QueryParams returns the query parameters as `url.Values`. | 
		
	
		
			
				|  |  |  |  | 		QueryParams() url.Values | 
		
	
	
		
			
				
					
					|  |  |  | @@ -69,90 +69,96 @@ type ( | 
		
	
		
			
				|  |  |  |  | 		QueryString() string | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// FormValue returns the form field value for the provided name. | 
		
	
		
			
				|  |  |  |  | 		FormValue(string) string | 
		
	
		
			
				|  |  |  |  | 		FormValue(name string) string | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// FormParams returns the form parameters as `url.Values`. | 
		
	
		
			
				|  |  |  |  | 		FormParams() (url.Values, error) | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// FormFile returns the multipart form file for the provided name. | 
		
	
		
			
				|  |  |  |  | 		FormFile(string) (*multipart.FileHeader, error) | 
		
	
		
			
				|  |  |  |  | 		FormFile(name string) (*multipart.FileHeader, error) | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// MultipartForm returns the multipart form. | 
		
	
		
			
				|  |  |  |  | 		MultipartForm() (*multipart.Form, error) | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// Cookie returns the named cookie provided in the request. | 
		
	
		
			
				|  |  |  |  | 		Cookie(string) (*http.Cookie, error) | 
		
	
		
			
				|  |  |  |  | 		Cookie(name string) (*http.Cookie, error) | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// SetCookie adds a `Set-Cookie` header in HTTP response. | 
		
	
		
			
				|  |  |  |  | 		SetCookie(*http.Cookie) | 
		
	
		
			
				|  |  |  |  | 		SetCookie(cookie *http.Cookie) | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// Cookies returns the HTTP cookies sent with the request. | 
		
	
		
			
				|  |  |  |  | 		Cookies() []*http.Cookie | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// Get retrieves data from the context. | 
		
	
		
			
				|  |  |  |  | 		Get(string) interface{} | 
		
	
		
			
				|  |  |  |  | 		Get(key string) interface{} | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// Set saves data in the context. | 
		
	
		
			
				|  |  |  |  | 		Set(string, interface{}) | 
		
	
		
			
				|  |  |  |  | 		Set(key string, val interface{}) | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// Bind binds the request body into provided type `i`. The default binder | 
		
	
		
			
				|  |  |  |  | 		// does it based on Content-Type header. | 
		
	
		
			
				|  |  |  |  | 		Bind(interface{}) error | 
		
	
		
			
				|  |  |  |  | 		Bind(i interface{}) error | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// Render renders a template with data and sends a text/html response with status | 
		
	
		
			
				|  |  |  |  | 		// code. Templates can be registered using `Echo.Renderer`. | 
		
	
		
			
				|  |  |  |  | 		Render(int, string, interface{}) error | 
		
	
		
			
				|  |  |  |  | 		Render(code int, name string, data interface{}) error | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// HTML sends an HTTP response with status code. | 
		
	
		
			
				|  |  |  |  | 		HTML(int, string) error | 
		
	
		
			
				|  |  |  |  | 		HTML(code int, html string) error | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// HTMLBlob sends an HTTP blob response with status code. | 
		
	
		
			
				|  |  |  |  | 		HTMLBlob(int, []byte) error | 
		
	
		
			
				|  |  |  |  | 		HTMLBlob(code int, b []byte) error | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// String sends a string response with status code. | 
		
	
		
			
				|  |  |  |  | 		String(int, string) error | 
		
	
		
			
				|  |  |  |  | 		String(code int, s string) error | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// JSON sends a JSON response with status code. | 
		
	
		
			
				|  |  |  |  | 		JSON(int, interface{}) error | 
		
	
		
			
				|  |  |  |  | 		JSON(code int, i interface{}) error | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// JSONPretty sends a pretty-print JSON with status code. | 
		
	
		
			
				|  |  |  |  | 		JSONPretty(code int, i interface{}, indent string) error | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// JSONBlob sends a JSON blob response with status code. | 
		
	
		
			
				|  |  |  |  | 		JSONBlob(int, []byte) error | 
		
	
		
			
				|  |  |  |  | 		JSONBlob(code int, b []byte) error | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// JSONP sends a JSONP response with status code. It uses `callback` to construct | 
		
	
		
			
				|  |  |  |  | 		// the JSONP payload. | 
		
	
		
			
				|  |  |  |  | 		JSONP(int, string, interface{}) error | 
		
	
		
			
				|  |  |  |  | 		JSONP(code int, callback string, i interface{}) error | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// JSONPBlob sends a JSONP blob response with status code. It uses `callback` | 
		
	
		
			
				|  |  |  |  | 		// to construct the JSONP payload. | 
		
	
		
			
				|  |  |  |  | 		JSONPBlob(int, string, []byte) error | 
		
	
		
			
				|  |  |  |  | 		JSONPBlob(code int, callback string, b []byte) error | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// XML sends an XML response with status code. | 
		
	
		
			
				|  |  |  |  | 		XML(int, interface{}) error | 
		
	
		
			
				|  |  |  |  | 		XML(code int, i interface{}) error | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// XMLPretty sends a pretty-print XML with status code. | 
		
	
		
			
				|  |  |  |  | 		XMLPretty(code int, i interface{}, indent string) error | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// XMLBlob sends a XML blob response with status code. | 
		
	
		
			
				|  |  |  |  | 		XMLBlob(int, []byte) error | 
		
	
		
			
				|  |  |  |  | 		XMLBlob(code int, b []byte) error | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// Blob sends a blob response with status code and content type. | 
		
	
		
			
				|  |  |  |  | 		Blob(int, string, []byte) error | 
		
	
		
			
				|  |  |  |  | 		Blob(code int, contentType string, b []byte) error | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// Stream sends a streaming response with status code and content type. | 
		
	
		
			
				|  |  |  |  | 		Stream(int, string, io.Reader) error | 
		
	
		
			
				|  |  |  |  | 		Stream(code int, contentType string, r io.Reader) error | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// File sends a response with the content of the file. | 
		
	
		
			
				|  |  |  |  | 		File(string) error | 
		
	
		
			
				|  |  |  |  | 		File(file string) error | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// Attachment sends a response as attachment, prompting client to save the | 
		
	
		
			
				|  |  |  |  | 		// file. | 
		
	
		
			
				|  |  |  |  | 		Attachment(string, string) error | 
		
	
		
			
				|  |  |  |  | 		Attachment(file string, name string) error | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// Inline sends a response as inline, opening the file in the browser. | 
		
	
		
			
				|  |  |  |  | 		Inline(string, string) error | 
		
	
		
			
				|  |  |  |  | 		Inline(file string, name string) error | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// NoContent sends a response with no body and a status code. | 
		
	
		
			
				|  |  |  |  | 		NoContent(int) error | 
		
	
		
			
				|  |  |  |  | 		NoContent(code int) error | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// Redirect redirects the request with status code. | 
		
	
		
			
				|  |  |  |  | 		Redirect(int, string) error | 
		
	
		
			
				|  |  |  |  | 		Redirect(code int, url string) error | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// Error invokes the registered HTTP error handler. Generally used by middleware. | 
		
	
		
			
				|  |  |  |  | 		Error(err error) | 
		
	
	
		
			
				
					
					|  |  |  | @@ -161,7 +167,7 @@ type ( | 
		
	
		
			
				|  |  |  |  | 		Handler() HandlerFunc | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// SetHandler sets the matched handler by router. | 
		
	
		
			
				|  |  |  |  | 		SetHandler(HandlerFunc) | 
		
	
		
			
				|  |  |  |  | 		SetHandler(h HandlerFunc) | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 		// Logger returns the `Logger` instance. | 
		
	
		
			
				|  |  |  |  | 		Logger() Logger | 
		
	
	
		
			
				
					
					|  |  |  | @@ -172,7 +178,7 @@ type ( | 
		
	
		
			
				|  |  |  |  | 		// Reset resets the context after request completes. It must be called along | 
		
	
		
			
				|  |  |  |  | 		// with `Echo#AcquireContext()` and `Echo#ReleaseContext()`. | 
		
	
		
			
				|  |  |  |  | 		// See `Echo#ServeHTTP()` | 
		
	
		
			
				|  |  |  |  | 		Reset(*http.Request, http.ResponseWriter) | 
		
	
		
			
				|  |  |  |  | 		Reset(r *http.Request, w http.ResponseWriter) | 
		
	
		
			
				|  |  |  |  | 	} | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | 	context struct { | 
		
	
	
		
			
				
					
					|  |  |  | @@ -329,6 +335,10 @@ func (c *context) Cookies() []*http.Cookie { | 
		
	
		
			
				|  |  |  |  | 	return c.request.Cookies() | 
		
	
		
			
				|  |  |  |  | } | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | func (c *context) Get(key string) interface{} { | 
		
	
		
			
				|  |  |  |  | 	return c.store[key] | 
		
	
		
			
				|  |  |  |  | } | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | func (c *context) Set(key string, val interface{}) { | 
		
	
		
			
				|  |  |  |  | 	if c.store == nil { | 
		
	
		
			
				|  |  |  |  | 		c.store = make(Map) | 
		
	
	
		
			
				
					
					|  |  |  | @@ -336,10 +346,6 @@ func (c *context) Set(key string, val interface{}) { | 
		
	
		
			
				|  |  |  |  | 	c.store[key] = val | 
		
	
		
			
				|  |  |  |  | } | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | func (c *context) Get(key string) interface{} { | 
		
	
		
			
				|  |  |  |  | 	return c.store[key] | 
		
	
		
			
				|  |  |  |  | } | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | func (c *context) Bind(i interface{}) error { | 
		
	
		
			
				|  |  |  |  | 	return c.echo.Binder.Bind(i, c) | 
		
	
		
			
				|  |  |  |  | } | 
		
	
	
		
			
				
					
					|  |  |  | @@ -369,11 +375,16 @@ func (c *context) String(code int, s string) (err error) { | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | func (c *context) JSON(code int, i interface{}) (err error) { | 
		
	
		
			
				|  |  |  |  | 	b, err := json.Marshal(i) | 
		
	
		
			
				|  |  |  |  | 	if c.echo.Debug { | 
		
	
		
			
				|  |  |  |  | 		b, err = json.MarshalIndent(i, "", "  ") | 
		
	
		
			
				|  |  |  |  | 	} | 
		
	
		
			
				|  |  |  |  | 	if err != nil { | 
		
	
		
			
				|  |  |  |  | 		return err | 
		
	
		
			
				|  |  |  |  | 		return | 
		
	
		
			
				|  |  |  |  | 	} | 
		
	
		
			
				|  |  |  |  | 	return c.JSONBlob(code, b) | 
		
	
		
			
				|  |  |  |  | } | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | func (c *context) JSONPretty(code int, i interface{}, indent string) (err error) { | 
		
	
		
			
				|  |  |  |  | 	b, err := json.MarshalIndent(i, "", indent) | 
		
	
		
			
				|  |  |  |  | 	if err != nil { | 
		
	
		
			
				|  |  |  |  | 		return | 
		
	
		
			
				|  |  |  |  | 	} | 
		
	
		
			
				|  |  |  |  | 	return c.JSONBlob(code, b) | 
		
	
		
			
				|  |  |  |  | } | 
		
	
	
		
			
				
					
					|  |  |  | @@ -385,7 +396,7 @@ func (c *context) JSONBlob(code int, b []byte) (err error) { | 
		
	
		
			
				|  |  |  |  | func (c *context) JSONP(code int, callback string, i interface{}) (err error) { | 
		
	
		
			
				|  |  |  |  | 	b, err := json.Marshal(i) | 
		
	
		
			
				|  |  |  |  | 	if err != nil { | 
		
	
		
			
				|  |  |  |  | 		return err | 
		
	
		
			
				|  |  |  |  | 		return | 
		
	
		
			
				|  |  |  |  | 	} | 
		
	
		
			
				|  |  |  |  | 	return c.JSONPBlob(code, callback, b) | 
		
	
		
			
				|  |  |  |  | } | 
		
	
	
		
			
				
					
					|  |  |  | @@ -405,15 +416,20 @@ func (c *context) JSONPBlob(code int, callback string, b []byte) (err error) { | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | func (c *context) XML(code int, i interface{}) (err error) { | 
		
	
		
			
				|  |  |  |  | 	b, err := xml.Marshal(i) | 
		
	
		
			
				|  |  |  |  | 	if c.echo.Debug { | 
		
	
		
			
				|  |  |  |  | 		b, err = xml.MarshalIndent(i, "", "  ") | 
		
	
		
			
				|  |  |  |  | 	} | 
		
	
		
			
				|  |  |  |  | 	if err != nil { | 
		
	
		
			
				|  |  |  |  | 		return err | 
		
	
		
			
				|  |  |  |  | 		return | 
		
	
		
			
				|  |  |  |  | 	} | 
		
	
		
			
				|  |  |  |  | 	return c.XMLBlob(code, b) | 
		
	
		
			
				|  |  |  |  | } | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | func (c *context) XMLPretty(code int, i interface{}, indent string) (err error) { | 
		
	
		
			
				|  |  |  |  | 	b, err := xml.MarshalIndent(i, "", indent) | 
		
	
		
			
				|  |  |  |  | 	if err != nil { | 
		
	
		
			
				|  |  |  |  | 		return | 
		
	
		
			
				|  |  |  |  | 	} | 
		
	
		
			
				|  |  |  |  | 	return c.JSONBlob(code, b) | 
		
	
		
			
				|  |  |  |  | } | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | func (c *context) XMLBlob(code int, b []byte) (err error) { | 
		
	
		
			
				|  |  |  |  | 	c.response.Header().Set(HeaderContentType, MIMEApplicationXMLCharsetUTF8) | 
		
	
		
			
				|  |  |  |  | 	c.response.WriteHeader(code) | 
		
	
	
		
			
				
					
					|  |  |  |   |