Index fetches the heartbeats for a phone number
(ctx context.Context, userID entities.UserID, owner string, params repositories.IndexParams)
| 70 | |
| 71 | // Index fetches the heartbeats for a phone number |
| 72 | func (service *HeartbeatService) Index(ctx context.Context, userID entities.UserID, owner string, params repositories.IndexParams) (*[]entities.Heartbeat, error) { |
| 73 | ctx, span := service.tracer.Start(ctx) |
| 74 | defer span.End() |
| 75 | |
| 76 | ctxLogger := service.tracer.CtxLogger(service.logger, span) |
| 77 | |
| 78 | heartbeats, err := service.repository.Index(ctx, userID, owner, params) |
| 79 | if err != nil { |
| 80 | msg := fmt.Sprintf("could not fetch heartbeats with parms [%+#v]", params) |
| 81 | return nil, service.tracer.WrapErrorSpan(span, stacktrace.Propagate(err, msg)) |
| 82 | } |
| 83 | |
| 84 | ctxLogger.Info(fmt.Sprintf("fetched [%d] messages with prams [%+#v]", len(*heartbeats), params)) |
| 85 | return heartbeats, nil |
| 86 | } |
| 87 | |
| 88 | // HeartbeatStoreParams are parameters for creating a new entities.Heartbeat |
| 89 | type HeartbeatStoreParams struct { |
nothing calls this directly
no test coverage detected