Add TCP Middlewares support
This commit is contained in:
parent
679def0151
commit
fc9f41b955
134 changed files with 5865 additions and 1852 deletions
|
@ -45,8 +45,9 @@ func (h Handler) getOverview(rw http.ResponseWriter, request *http.Request) {
|
|||
Middlewares: getHTTPMiddlewareSection(h.runtimeConfiguration.Middlewares),
|
||||
},
|
||||
TCP: schemeOverview{
|
||||
Routers: getTCPRouterSection(h.runtimeConfiguration.TCPRouters),
|
||||
Services: getTCPServiceSection(h.runtimeConfiguration.TCPServices),
|
||||
Routers: getTCPRouterSection(h.runtimeConfiguration.TCPRouters),
|
||||
Services: getTCPServiceSection(h.runtimeConfiguration.TCPServices),
|
||||
Middlewares: getTCPMiddlewareSection(h.runtimeConfiguration.TCPMiddlewares),
|
||||
},
|
||||
UDP: schemeOverview{
|
||||
Routers: getUDPRouterSection(h.runtimeConfiguration.UDPRouters),
|
||||
|
@ -160,6 +161,25 @@ func getTCPServiceSection(services map[string]*runtime.TCPServiceInfo) *section
|
|||
}
|
||||
}
|
||||
|
||||
func getTCPMiddlewareSection(middlewares map[string]*runtime.TCPMiddlewareInfo) *section {
|
||||
var countErrors int
|
||||
var countWarnings int
|
||||
for _, mid := range middlewares {
|
||||
switch mid.Status {
|
||||
case runtime.StatusDisabled:
|
||||
countErrors++
|
||||
case runtime.StatusWarning:
|
||||
countWarnings++
|
||||
}
|
||||
}
|
||||
|
||||
return §ion{
|
||||
Total: len(middlewares),
|
||||
Warnings: countWarnings,
|
||||
Errors: countErrors,
|
||||
}
|
||||
}
|
||||
|
||||
func getUDPRouterSection(routers map[string]*runtime.UDPRouterInfo) *section {
|
||||
var countErrors int
|
||||
var countWarnings int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue