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

Method GetUserOnlineStats

backend/xray/api/stats.go:51–62  ·  view source on GitHub ↗
(ctx context.Context, email string)

Source from the content-addressed store, hash-verified

49}
50
51func (x *XrayHandler) GetUserOnlineStats(ctx context.Context, email string) (*common.OnlineStatResponse, error) {
52 if email == "" {
53 return nil, errors.New("email required")
54 }
55 client := *x.StatsServiceClient
56 resp, err := client.GetStatsOnline(ctx, &command.GetStatsRequest{Name: fmt.Sprintf("user>>>%s>>>online", email)})
57 if err != nil {
58 return nil, err
59 }
60
61 return &common.OnlineStatResponse{Name: email, Value: resp.GetStat().GetValue()}, nil
62}
63
64func (x *XrayHandler) GetUserOnlineIpListStats(ctx context.Context, email string) (*common.StatsOnlineIpListResponse, error) {
65 if email == "" {

Callers

nothing calls this directly

Calls 1

GetValueMethod · 0.45

Tested by

no test coverage detected