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

Method SearchMessages

api/pkg/services/message_service.go:1021–1035  ·  view source on GitHub ↗

SearchMessages fetches all the messages for a user

(ctx context.Context, params *MessageSearchParams)

Source from the content-addressed store, hash-verified

1019
1020// SearchMessages fetches all the messages for a user
1021func (service *MessageService) SearchMessages(ctx context.Context, params *MessageSearchParams) ([]*entities.Message, error) {
1022 ctx, span := service.tracer.Start(ctx)
1023 defer span.End()
1024
1025 ctxLogger := service.tracer.CtxLogger(service.logger, span)
1026
1027 messages, err := service.repository.Search(ctx, params.UserID, params.Owners, params.Types, params.Statuses, params.IndexParams)
1028 if err != nil {
1029 msg := fmt.Sprintf("could not search messages with parms [%+#v]", params)
1030 return nil, service.tracer.WrapErrorSpan(span, stacktrace.Propagate(err, msg))
1031 }
1032
1033 ctxLogger.Info(fmt.Sprintf("fetched [%d] messages with prams [%+#v]", len(messages), params))
1034 return messages, nil
1035}
1036
1037func (service *MessageService) phoneSettings(ctx context.Context, userID entities.UserID, owner string) (uint, entities.SIM, uint) {
1038 ctx, span := service.tracer.Start(ctx)

Callers 1

SearchMethod · 0.80

Calls 5

StartMethod · 0.65
CtxLoggerMethod · 0.65
SearchMethod · 0.65
WrapErrorSpanMethod · 0.65
InfoMethod · 0.65

Tested by

no test coverage detected