1
0
mirror of https://github.com/labstack/echo.git synced 2024-11-28 08:38:39 +02:00

RunWithConfig to RunConfig

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2016-02-08 08:36:26 -08:00
parent 65fcca2ce3
commit 3f48b92c5d

View File

@ -543,7 +543,7 @@ func (e *Echo) SetEngine(t engine.Type) {
// Run runs a server. // Run runs a server.
func (e *Echo) Run(addr string) { func (e *Echo) Run(addr string) {
c := &engine.Config{Address: addr} c := &engine.Config{Address: addr}
e.RunWithConfig(c) e.RunConfig(c)
} }
// RunTLS runs a server with TLS configuration. // RunTLS runs a server with TLS configuration.
@ -553,11 +553,11 @@ func (e *Echo) RunTLS(addr, certfile, keyfile string) {
TLSCertfile: certfile, TLSCertfile: certfile,
TLSKeyfile: keyfile, TLSKeyfile: keyfile,
} }
e.RunWithConfig(c) e.RunConfig(c)
} }
// RunWithConfig runs a server with engine configuration. // RunConfig runs a server with engine configuration.
func (e *Echo) RunWithConfig(config *engine.Config) { func (e *Echo) RunConfig(config *engine.Config) {
handler := func(req engine.Request, res engine.Response) { handler := func(req engine.Request, res engine.Response) {
if e.hook != nil { if e.hook != nil {
e.hook(req, res) e.hook(req, res)