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

Method Delete

api/pkg/services/discord_service.go:88–106  ·  view source on GitHub ↗

Delete an entities.Discord

(ctx context.Context, userID entities.UserID, discordID uuid.UUID)

Source from the content-addressed store, hash-verified

86
87// Delete an entities.Discord
88func (service *DiscordService) Delete(ctx context.Context, userID entities.UserID, discordID uuid.UUID) error {
89 ctx, span := service.tracer.Start(ctx)
90 defer span.End()
91
92 ctxLogger := service.tracer.CtxLogger(service.logger, span)
93
94 if _, err := service.repository.Load(ctx, userID, discordID); err != nil {
95 msg := fmt.Sprintf("cannot load discord integration with userID [%s] and discordID [%s]", userID, discordID)
96 return service.tracer.WrapErrorSpan(span, stacktrace.PropagateWithCode(err, stacktrace.GetCode(err), msg))
97 }
98
99 if err := service.repository.Delete(ctx, userID, discordID); err != nil {
100 msg := fmt.Sprintf("cannot delete discord integration with id [%s] and discordID [%s]", discordID, userID)
101 return service.tracer.WrapErrorSpan(span, stacktrace.Propagate(err, msg))
102 }
103
104 ctxLogger.Info(fmt.Sprintf("deleted discord integration with id [%s] and user id [%s]", discordID, userID))
105 return nil
106}
107
108// DiscordStoreParams are parameters for creating a new entities.Discord
109type DiscordStoreParams struct {

Callers

nothing calls this directly

Calls 6

StartMethod · 0.65
CtxLoggerMethod · 0.65
LoadMethod · 0.65
WrapErrorSpanMethod · 0.65
DeleteMethod · 0.65
InfoMethod · 0.65

Tested by

no test coverage detected