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

Method AddInboundUser

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

Source from the content-addressed store, hash-verified

26}
27
28func (x *XrayHandler) AddInboundUser(ctx context.Context, tag string, user Account) error {
29 // Create the AddUserOperation message
30 account, err := user.Message()
31 if err != nil {
32 return err
33 }
34 operation, err := ToTypedMessage(&command.AddUserOperation{
35 User: &protocol.User{
36 Level: user.GetLevel(),
37 Email: user.GetEmail(),
38 Account: account,
39 },
40 })
41 if err != nil {
42 return err
43 }
44
45 // Call the AlterInbound method with the AddUserOperation message
46 return x.AlertInbound(ctx, tag, operation)
47}
48
49func (x *XrayHandler) RemoveInboundUser(ctx context.Context, tag, email string) error {
50 operation, err := ToTypedMessage(&command.RemoveUserOperation{

Callers 2

SyncUserMethod · 0.80
UpdateUsersMethod · 0.80

Calls 5

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

Tested by

no test coverage detected