MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / MaxWebhooksForUser

Method MaxWebhooksForUser

internal/identity/webhooks.go:323–338  ·  view source on GitHub ↗
(ctx context.Context, userID string)

Source from the content-addressed store, hash-verified

321const DefaultMaxWebhooks = 50
322
323func (s *Store) MaxWebhooksForUser(ctx context.Context, userID string) (int, error) {
324 var n *int
325 err := s.pool.QueryRow(ctx,
326 `SELECT max_webhooks FROM account_limits WHERE user_id = $1`, userID,
327 ).Scan(&n)
328 if err != nil {
329 if errors.Is(err, pgx.ErrNoRows) {
330 return DefaultMaxWebhooks, nil
331 }
332 return 0, err
333 }
334 if n == nil {
335 return DefaultMaxWebhooks, nil
336 }
337 return *n, nil
338}
339
340// WebhookUpdate carries the fields a PATCH can change. All fields are
341// pointers (or "set-or-leave" flags) so handlers can distinguish

Implementers 1

Storeinternal/identity/store.go

Calls 2

ScanMethod · 0.80
QueryRowMethod · 0.80