mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-16 13:27:16 +03:00
API: Add ListInbounds and ListOutbounds (#4723)
This commit is contained in:
@ -145,6 +145,21 @@ func (m *Manager) RemoveHandler(ctx context.Context, tag string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ListHandlers implements outbound.Manager.
|
||||
func (m *Manager) ListHandlers(ctx context.Context) []outbound.Handler {
|
||||
m.access.RLock()
|
||||
defer m.access.RUnlock()
|
||||
|
||||
var response []outbound.Handler
|
||||
copy(m.untaggedHandlers, response)
|
||||
|
||||
for _, v := range m.taggedHandler {
|
||||
response = append(response, v)
|
||||
}
|
||||
|
||||
return response
|
||||
}
|
||||
|
||||
// Select implements outbound.HandlerSelector.
|
||||
func (m *Manager) Select(selectors []string) []string {
|
||||
|
||||
|
Reference in New Issue
Block a user