mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-24 01:38:50 +02:00
fix reload stuck
This commit is contained in:
@@ -18,6 +18,15 @@ func GetStreamRoutes() F.Map[string, types.StreamRoute] {
|
||||
return streamRoutes
|
||||
}
|
||||
|
||||
func GetHTTPRouteOrExact(alias, host string) (types.HTTPRoute, bool) {
|
||||
r, ok := httpRoutes.Load(alias)
|
||||
if ok {
|
||||
return r, true
|
||||
}
|
||||
// try find with exact match
|
||||
return httpRoutes.Load(host)
|
||||
}
|
||||
|
||||
func GetHTTPRoute(alias string) (types.HTTPRoute, bool) {
|
||||
return httpRoutes.Load(alias)
|
||||
}
|
||||
@@ -41,3 +50,8 @@ func DeleteHTTPRoute(alias string) {
|
||||
func DeleteStreamRoute(alias string) {
|
||||
streamRoutes.Delete(alias)
|
||||
}
|
||||
|
||||
func TestClear() {
|
||||
httpRoutes = F.NewMapOf[string, types.HTTPRoute]()
|
||||
streamRoutes = F.NewMapOf[string, types.StreamRoute]()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user