MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / xrayRemoveUser

Function xrayRemoveUser

internal/xray/manager.go:925–943  ·  view source on GitHub ↗

xrayRemoveUser 通过 in-process proxy.UserManager 接口热删用户。

(ctx context.Context, instance *xrayCore.Instance, tag, email string)

Source from the content-addressed store, hash-verified

923
924// xrayRemoveUser 通过 in-process proxy.UserManager 接口热删用户。
925func xrayRemoveUser(ctx context.Context, instance *xrayCore.Instance, tag, email string) error {
926 ihm, ok := instance.GetFeature(inbound.ManagerType()).(inbound.Manager)
927 if !ok {
928 return fmt.Errorf("RemoveUser: inbound manager not available")
929 }
930 handler, err := ihm.GetHandler(ctx, tag)
931 if err != nil {
932 return fmt.Errorf("RemoveUser: get handler %q: %w", tag, err)
933 }
934 gi, ok := handler.(proxy.GetInbound)
935 if !ok {
936 return fmt.Errorf("RemoveUser: handler %q does not support GetInbound", tag)
937 }
938 um, ok := gi.GetInbound().(proxy.UserManager)
939 if !ok {
940 return fmt.Errorf("RemoveUser: inbound %q does not support UserManager", tag)
941 }
942 return um.RemoveUser(ctx, email)
943}
944
945// extractInboundPorts 从 xray JSON 配置中提取所有 inbound 的监听端口。
946func extractInboundPorts(config string) map[int]struct{} {

Callers 1

RemoveUserMethod · 0.85

Calls 2

GetInboundMethod · 0.65
RemoveUserMethod · 0.65

Tested by

no test coverage detected