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

Method Index

api/pkg/services/webhook_service.go:73–87  ·  view source on GitHub ↗

Index fetches the entities.Webhook for an entities.UserID

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

Source from the content-addressed store, hash-verified

71
72// Index fetches the entities.Webhook for an entities.UserID
73func (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
90func (service *WebhookService) Delete(ctx context.Context, userID entities.UserID, webhookID uuid.UUID) 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