MCPcopy Create free account
hub / github.com/gogs/gogs / getWebhook

Function getWebhook

internal/database/webhook.go:260–268  ·  view source on GitHub ↗

getWebhook uses argument bean as query condition, ID must be specified and do not assign unnecessary fields.

(bean *Webhook)

Source from the content-addressed store, hash-verified

258// getWebhook uses argument bean as query condition,
259// ID must be specified and do not assign unnecessary fields.
260func getWebhook(bean *Webhook) (*Webhook, error) {
261 has, err := x.Get(bean)
262 if err != nil {
263 return nil, err
264 } else if !has {
265 return nil, ErrWebhookNotExist{args: map[string]any{"webhookID": bean.ID}}
266 }
267 return bean, nil
268}
269
270// GetWebhookByID returns webhook by given ID.
271// Use this function with caution of accessing unauthorized webhook,

Callers 3

GetWebhookByIDFunction · 0.85
GetWebhookOfRepoByIDFunction · 0.85
GetWebhookByOrgIDFunction · 0.85

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected