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

Method updateUser

backend/xray/config.go:205–239  ·  view source on GitHub ↗
(account api.Account)

Source from the content-addressed store, hash-verified

203}
204
205func (i *Inbound) updateUser(account api.Account) {
206 i.mu.Lock()
207 defer i.mu.Unlock()
208
209 if i.clients == nil {
210 i.clients = make(map[string]api.Account)
211 }
212
213 email := account.GetEmail()
214 switch a := account.(type) {
215 case *api.VmessAccount:
216 i.clients[email] = a
217
218 case *api.VlessAccount:
219 i.clients[email] = a
220
221 case *api.TrojanAccount:
222 i.clients[email] = a
223
224 case *api.ShadowsocksTcpAccount:
225 i.clients[email] = a
226
227 case *api.ShadowsocksAccount:
228 method, ok := i.Settings["method"].(string)
229 if ok {
230 na := checkShadowsocks2022(method, *a)
231 i.clients[email] = &na
232 } else {
233 i.clients[email] = a
234 }
235
236 case *api.HysteriaAccount:
237 i.clients[email] = a
238 }
239}
240
241func (i *Inbound) updateUsers(accounts []api.Account, removeEmails []string) {
242 i.mu.Lock()

Callers 1

SyncUserMethod · 0.80

Calls 2

checkShadowsocks2022Function · 0.85
GetEmailMethod · 0.65

Tested by

no test coverage detected