MCPcopy Create free account
hub / github.com/PasarGuard/node / AddOutboundUser

Method AddOutboundUser

backend/xray/api/proxyman.go:61–80  ·  view source on GitHub ↗
(ctx context.Context, tag string, user Account)

Source from the content-addressed store, hash-verified

59}
60
61func (x *XrayHandler) AddOutboundUser(ctx context.Context, tag string, user Account) error {
62 // Create the AddUserOperation message
63 account, err := user.Message()
64 if err != nil {
65 return err
66 }
67 operation, err := ToTypedMessage(&command.AddUserOperation{
68 User: &protocol.User{
69 Level: user.GetLevel(),
70 Email: user.GetEmail(),
71 Account: account,
72 },
73 })
74 if err != nil {
75 return err
76 }
77
78 // Call the AlterInbound method with the AddUserOperation message
79 return x.AlertOutbound(ctx, tag, operation)
80}
81
82func (x *XrayHandler) RemoveOutboundUser(ctx context.Context, tag, email string) error {
83 operation, err := ToTypedMessage(&command.RemoveUserOperation{

Callers

nothing calls this directly

Calls 5

AlertOutboundMethod · 0.95
ToTypedMessageFunction · 0.85
MessageMethod · 0.65
GetLevelMethod · 0.65
GetEmailMethod · 0.65

Tested by

no test coverage detected