MCPcopy Index your code
hub / github.com/labstack/echo / NewWithConfig

Function NewWithConfig

echo.go:330–368  ·  view source on GitHub ↗

NewWithConfig creates an instance of Echo with given configuration.

(config Config)

Source from the content-addressed store, hash-verified

328
329// NewWithConfig creates an instance of Echo with given configuration.
330func NewWithConfig(config Config) *Echo {
331 e := New()
332 if config.Logger != nil {
333 e.Logger = config.Logger
334 }
335 if config.HTTPErrorHandler != nil {
336 e.HTTPErrorHandler = config.HTTPErrorHandler
337 }
338 if config.Router != nil {
339 e.router = config.Router
340 }
341 if config.OnAddRoute != nil {
342 e.OnAddRoute = config.OnAddRoute
343 }
344 if config.Filesystem != nil {
345 e.Filesystem = config.Filesystem
346 }
347 if config.Binder != nil {
348 e.Binder = config.Binder
349 }
350 if config.Validator != nil {
351 e.Validator = config.Validator
352 }
353 if config.Renderer != nil {
354 e.Renderer = config.Renderer
355 }
356 if config.JSONSerializer != nil {
357 e.JSONSerializer = config.JSONSerializer
358 }
359 if config.IPExtractor != nil {
360 e.IPExtractor = config.IPExtractor
361 }
362 if config.FormParseMaxMemory > 0 {
363 e.formParseMaxMemory = config.FormParseMaxMemory
364 }
365 e.enablePathUnescapingStaticFiles = config.EnablePathUnescapingStaticFiles
366
367 return e
368}
369
370// New creates an instance of Echo.
371func New() *Echo {

Calls 1

NewFunction · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…