mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 00:38:33 +02:00
refactor(routes): replace route retrieval with GetIncludeExcluded
- Updated route retrieval in the API and idle watcher to use GetIncludeExcluded, allowing for the inclusion of excluded routes. - Simplified the route status aggregation logic by directly using GetIncludeExcluded for display name resolution. - Removed redundant code that separately handled excluded routes, streamlining the route management process.
This commit is contained in:
@@ -78,3 +78,14 @@ func Get(alias string) (types.Route, bool) {
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
|
||||
// GetIncludeExcluded returns the route with the given alias, including excluded routes.
|
||||
func GetIncludeExcluded(alias string) (types.Route, bool) {
|
||||
if r, ok := HTTP.Get(alias); ok {
|
||||
return r, true
|
||||
}
|
||||
if r, ok := Stream.Get(alias); ok {
|
||||
return r, true
|
||||
}
|
||||
return Excluded.Get(alias)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user