1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-24 20:14:31 +02:00

Add echo.Binder() method

This commit is contained in:
Victor Gaydov 2016-04-27 15:57:35 +03:00 committed by Vishal Rana
parent a708a6781a
commit 4fd9f14769
2 changed files with 12 additions and 0 deletions

View File

@ -293,6 +293,11 @@ func (e *Echo) SetBinder(b Binder) {
e.binder = b
}
// Binder returns the binder instance.
func (e *Echo) Binder() Binder {
return e.binder
}
// SetRenderer registers an HTML template renderer. It's invoked by `Context#Render()`.
func (e *Echo) SetRenderer(r Renderer) {
e.renderer = r

View File

@ -333,3 +333,10 @@ func request(method, path string, e *Echo) (int, string) {
e.ServeHTTP(req, rec)
return rec.Status(), rec.Body.String()
}
func TestEchoBinder(t *testing.T) {
e := New()
b := &binder{}
e.SetBinder(b)
assert.Equal(t, b, e.Binder())
}