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

Method Index

api/pkg/services/phone_service.go:74–88  ·  view source on GitHub ↗

Index fetches the heartbeats for a phone number

(ctx context.Context, authUser entities.AuthContext, params repositories.IndexParams)

Source from the content-addressed store, hash-verified

72
73// Index fetches the heartbeats for a phone number
74func (service *PhoneService) Index(ctx context.Context, authUser entities.AuthContext, params repositories.IndexParams) (*[]entities.Phone, error) {
75 ctx, span := service.tracer.Start(ctx)
76 defer span.End()
77
78 ctxLogger := service.tracer.CtxLogger(service.logger, span)
79
80 phones, err := service.repository.Index(ctx, authUser.ID, params)
81 if err != nil {
82 msg := fmt.Sprintf("could not fetch phones with parms [%+#v]", params)
83 return nil, service.tracer.WrapErrorSpan(span, stacktrace.Propagate(err, msg))
84 }
85
86 ctxLogger.Info(fmt.Sprintf("fetched [%d] phones with prams [%+#v]", len(*phones), params))
87 return phones, nil
88}
89
90// Load a phone by userID and owner
91func (service *PhoneService) Load(ctx context.Context, userID entities.UserID, owner string) (*entities.Phone, error) {

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