mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-03-12 11:49:55 +00:00
chore: clean up internal interface definitions
This commit is contained in:
@@ -31,7 +31,7 @@ func groupRouter() http.Handler {
|
||||
func getGroups(w http.ResponseWriter, r *http.Request) {
|
||||
var gs []C.Proxy
|
||||
for _, p := range tunnel.Proxies() {
|
||||
if _, ok := p.Adapter().(C.Group); ok {
|
||||
if _, ok := p.Adapter().(outboundgroup.ProxyGroup); ok {
|
||||
gs = append(gs, p)
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ func getGroups(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
func getGroup(w http.ResponseWriter, r *http.Request) {
|
||||
proxy := r.Context().Value(CtxKeyProxy).(C.Proxy)
|
||||
if _, ok := proxy.Adapter().(C.Group); ok {
|
||||
if _, ok := proxy.Adapter().(outboundgroup.ProxyGroup); ok {
|
||||
render.JSON(w, r, proxy)
|
||||
return
|
||||
}
|
||||
@@ -52,7 +52,7 @@ func getGroup(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
func getGroupDelay(w http.ResponseWriter, r *http.Request) {
|
||||
proxy := r.Context().Value(CtxKeyProxy).(C.Proxy)
|
||||
group, ok := proxy.Adapter().(C.Group)
|
||||
group, ok := proxy.Adapter().(outboundgroup.ProxyGroup)
|
||||
if !ok {
|
||||
render.Status(r, http.StatusNotFound)
|
||||
render.JSON(w, r, ErrNotFound)
|
||||
|
||||
Reference in New Issue
Block a user