Index fetches the entities.Webhook for an entities.UserID
(ctx context.Context, userID entities.UserID, params repositories.IndexParams)
| 71 | |
| 72 | // Index fetches the entities.Webhook for an entities.UserID |
| 73 | func (service *WebhookService) Index(ctx context.Context, userID entities.UserID, params repositories.IndexParams) ([]*entities.Webhook, error) { |
| 74 | ctx, span := service.tracer.Start(ctx) |
| 75 | defer span.End() |
| 76 | |
| 77 | ctxLogger := service.tracer.CtxLogger(service.logger, span) |
| 78 | |
| 79 | webhooks, err := service.repository.Index(ctx, userID, params) |
| 80 | if err != nil { |
| 81 | msg := fmt.Sprintf("could not fetch webhooks with params [%+#v]", params) |
| 82 | return nil, service.tracer.WrapErrorSpan(span, stacktrace.Propagate(err, msg)) |
| 83 | } |
| 84 | |
| 85 | ctxLogger.Info(fmt.Sprintf("fetched [%d] webhooks with prams [%+#v]", len(webhooks), params)) |
| 86 | return webhooks, nil |
| 87 | } |
| 88 | |
| 89 | // Delete an entities.Webhook |
| 90 | func (service *WebhookService) Delete(ctx context.Context, userID entities.UserID, webhookID uuid.UUID) error { |
nothing calls this directly
no test coverage detected