API: Add ListRule() for routing (#5569)

https://github.com/XTLS/Xray-core/pull/5569#issuecomment-3766310407
This commit is contained in:
MouMeng
2026-01-23 23:44:16 +08:00
committed by GitHub
parent 5846f94784
commit 59dc2cee2e
8 changed files with 457 additions and 283 deletions

View File

@@ -16,6 +16,7 @@ type Router interface {
PickRoute(ctx Context) (Route, error)
AddRule(config *serial.TypedMessage, shouldAppend bool) error
RemoveRule(tag string) error
ListRule() []Route
}
// Route is the routing result of Router feature.
@@ -65,6 +66,11 @@ func (DefaultRouter) RemoveRule(tag string) error {
return common.ErrNoClue
}
// ListRule implements Router.
func (DefaultRouter) ListRule() []Route {
return nil
}
// Start implements common.Runnable.
func (DefaultRouter) Start() error {
return nil