mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 12:42:34 +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/homepage"
|
||||||
"github.com/yusing/go-proxy/internal/route/entry"
|
"github.com/yusing/go-proxy/internal/route/entry"
|
||||||
provider "github.com/yusing/go-proxy/internal/route/provider/types"
|
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"
|
route "github.com/yusing/go-proxy/internal/route/types"
|
||||||
"github.com/yusing/go-proxy/internal/utils/strutils"
|
"github.com/yusing/go-proxy/internal/utils/strutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func HomepageConfig(useDefaultCategories bool) homepage.Config {
|
func HomepageConfig(useDefaultCategories bool) homepage.Config {
|
||||||
hpCfg := homepage.NewHomePageConfig()
|
hpCfg := homepage.NewHomePageConfig()
|
||||||
GetHTTPRoutes().RangeAll(func(alias string, r types.HTTPRoute) {
|
GetHTTPRoutes().RangeAll(func(alias string, r route.HTTPRoute) {
|
||||||
en := r.RawEntry()
|
en := r.RawEntry()
|
||||||
item := en.Homepage
|
item := en.Homepage
|
||||||
if item == nil {
|
if item == nil {
|
||||||
|
@ -86,11 +85,11 @@ func RoutesByAlias(typeFilter ...route.RouteType) map[string]any {
|
||||||
for _, t := range typeFilter {
|
for _, t := range typeFilter {
|
||||||
switch t {
|
switch t {
|
||||||
case route.RouteTypeReverseProxy:
|
case route.RouteTypeReverseProxy:
|
||||||
GetHTTPRoutes().RangeAll(func(alias string, r types.HTTPRoute) {
|
GetHTTPRoutes().RangeAll(func(alias string, r route.HTTPRoute) {
|
||||||
rts[alias] = r
|
rts[alias] = r
|
||||||
})
|
})
|
||||||
case route.RouteTypeStream:
|
case route.RouteTypeStream:
|
||||||
GetStreamRoutes().RangeAll(func(alias string, r types.StreamRoute) {
|
GetStreamRoutes().RangeAll(func(alias string, r route.StreamRoute) {
|
||||||
rts[alias] = r
|
rts[alias] = r
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue