MCPcopy
hub / github.com/labstack/echo / Start

Method Start

echo.go:813–818  ·  view source on GitHub ↗

Start stars HTTP server on given address with Echo as a handler serving requests. The server can be shutdown by sending os.Interrupt signal with `ctrl+c`. Method returns only errors that are not http.ErrServerClosed. Note: this method is created for use in examples/demos and is deliberately simple

(address string)

Source from the content-addressed store, hash-verified

811// slog.Error(err.Error())
812// }
813func (e *Echo) Start(address string) error {
814 sc := StartConfig{Address: address}
815 ctx, cancel := signal.NotifyContext(stdContext.Background(), os.Interrupt, syscall.SIGTERM) // start shutdown process on ctrl+c
816 defer cancel()
817 return sc.Start(ctx, e)
818}
819
820// WrapHandler wraps `http.Handler` into `echo.HandlerFunc`.
821func WrapHandler(h http.Handler) HandlerFunc {

Callers 4

startOnRandomPortFunction · 0.45
TestStartConfig_StartFunction · 0.45
TestEcho_StartFunction · 0.45

Calls 1

StartMethod · 0.95

Tested by 4

startOnRandomPortFunction · 0.36
TestStartConfig_StartFunction · 0.36
TestEcho_StartFunction · 0.36