Add custom http listener support
This commit is contained in:
@ -3,6 +3,7 @@ package app
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"net"
|
||||
"net/http"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
@ -25,10 +26,11 @@ type App struct {
|
||||
}
|
||||
|
||||
type AppHTTP struct {
|
||||
Funcs []srv.HTTPFunc
|
||||
Middleware []http.Handler
|
||||
HealthChecks []srv.HealthCheckFunc
|
||||
httpDone <-chan interface{}
|
||||
Funcs []srv.HTTPFunc // Handle funcs to serve
|
||||
Middleware []http.Handler // Optional middleware. Next handler called by app framework.
|
||||
HealthChecks []srv.HealthCheckFunc // Health-check functions to be called by health endpoint
|
||||
CustomListener net.Listener // Optional listener for http server
|
||||
httpDone <-chan interface{}
|
||||
}
|
||||
|
||||
type (
|
||||
@ -85,6 +87,7 @@ func (a *App) initHTTP() {
|
||||
HandleFuncs: a.HTTP.Funcs,
|
||||
Middleware: a.HTTP.Middleware,
|
||||
HealthCheckFuncs: a.HTTP.HealthChecks,
|
||||
CustomListener: a.HTTP.CustomListener,
|
||||
},
|
||||
)
|
||||
a.shutdownFuncs = append(a.shutdownFuncs, httpShutdown)
|
||||
|
Reference in New Issue
Block a user