mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 04:42:33 +02:00
refactor query.go
This commit is contained in:
parent
e28c4a1b4d
commit
c572382f6a
1 changed files with 3 additions and 4 deletions
|
@ -6,14 +6,13 @@ import (
|
|||
"github.com/yusing/go-proxy/internal/homepage"
|
||||
"github.com/yusing/go-proxy/internal/route/entry"
|
||||
provider "github.com/yusing/go-proxy/internal/route/provider/types"
|
||||
"github.com/yusing/go-proxy/internal/route/types"
|
||||
route "github.com/yusing/go-proxy/internal/route/types"
|
||||
"github.com/yusing/go-proxy/internal/utils/strutils"
|
||||
)
|
||||
|
||||
func HomepageConfig(useDefaultCategories bool) homepage.Config {
|
||||
hpCfg := homepage.NewHomePageConfig()
|
||||
GetHTTPRoutes().RangeAll(func(alias string, r types.HTTPRoute) {
|
||||
GetHTTPRoutes().RangeAll(func(alias string, r route.HTTPRoute) {
|
||||
en := r.RawEntry()
|
||||
item := en.Homepage
|
||||
if item == nil {
|
||||
|
@ -86,11 +85,11 @@ func RoutesByAlias(typeFilter ...route.RouteType) map[string]any {
|
|||
for _, t := range typeFilter {
|
||||
switch t {
|
||||
case route.RouteTypeReverseProxy:
|
||||
GetHTTPRoutes().RangeAll(func(alias string, r types.HTTPRoute) {
|
||||
GetHTTPRoutes().RangeAll(func(alias string, r route.HTTPRoute) {
|
||||
rts[alias] = r
|
||||
})
|
||||
case route.RouteTypeStream:
|
||||
GetStreamRoutes().RangeAll(func(alias string, r types.StreamRoute) {
|
||||
GetStreamRoutes().RangeAll(func(alias string, r route.StreamRoute) {
|
||||
rts[alias] = r
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue