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

Method Index

api/pkg/services/discord_service.go:71–85  ·  view source on GitHub ↗

Index fetches the entities.Discord for an entities.UserID

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

Source from the content-addressed store, hash-verified

69
70// Index fetches the entities.Discord for an entities.UserID
71func (service *DiscordService) Index(ctx context.Context, userID entities.UserID, params repositories.IndexParams) ([]*entities.Discord, error) {
72 ctx, span := service.tracer.Start(ctx)
73 defer span.End()
74
75 ctxLogger := service.tracer.CtxLogger(service.logger, span)
76
77 discordIntegrations, err := service.repository.Index(ctx, userID, params)
78 if err != nil {
79 msg := fmt.Sprintf("could not fetch discord integrations with params [%+#v]", params)
80 return nil, service.tracer.WrapErrorSpan(span, stacktrace.Propagate(err, msg))
81 }
82
83 ctxLogger.Info(fmt.Sprintf("fetched [%d] discord integrations with prams [%+#v]", len(discordIntegrations), params))
84 return discordIntegrations, nil
85}
86
87// Delete an entities.Discord
88func (service *DiscordService) Delete(ctx context.Context, userID entities.UserID, discordID 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