MCPcopy Index your code
hub / github.com/NdoleStudio/httpsms / Index

Method Index

api/pkg/services/heartbeat_service.go:72–86  ·  view source on GitHub ↗

Index fetches the heartbeats for a phone number

(ctx context.Context, userID entities.UserID, owner string, params repositories.IndexParams)

Source from the content-addressed store, hash-verified

70
71// Index fetches the heartbeats for a phone number
72func (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
89type HeartbeatStoreParams struct {

Callers

nothing calls this directly

Calls 5

StartMethod · 0.65
CtxLoggerMethod · 0.65
IndexMethod · 0.65
WrapErrorSpanMethod · 0.65
InfoMethod · 0.65

Tested by

no test coverage detected