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

Method Index

api/pkg/services/phone_api_key_service.go:52–64  ·  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

50
51// Index fetches the entities.Webhook for an entities.UserID
52func (service *PhoneAPIKeyService) Index(ctx context.Context, userID entities.UserID, params repositories.IndexParams) ([]*entities.PhoneAPIKey, error) {
53 ctx, span, ctxLogger := service.tracer.StartWithLogger(ctx, service.logger)
54 defer span.End()
55
56 phoneAPIKeys, err := service.repository.Index(ctx, userID, params)
57 if err != nil {
58 msg := fmt.Sprintf("could not fetch phone API Keys with params [%+#v]", params)
59 return nil, service.tracer.WrapErrorSpan(span, stacktrace.Propagate(err, msg))
60 }
61
62 ctxLogger.Info(fmt.Sprintf("fetched [%d] phone API Keys with prams [%+#v]", len(phoneAPIKeys), params))
63 return phoneAPIKeys, nil
64}
65
66// Create a new entities.PhoneAPIKey
67func (service *PhoneAPIKeyService) Create(ctx context.Context, authContext entities.AuthContext, name string) (*entities.PhoneAPIKey, error) {

Callers

nothing calls this directly

Calls 4

StartWithLoggerMethod · 0.65
IndexMethod · 0.65
WrapErrorSpanMethod · 0.65
InfoMethod · 0.65

Tested by

no test coverage detected