| 49 | } |
| 50 | |
| 51 | func (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 | |
| 64 | func (x *XrayHandler) GetUserOnlineIpListStats(ctx context.Context, email string) (*common.StatsOnlineIpListResponse, error) { |
| 65 | if email == "" { |