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

Function TestWebhook

internal/database/webhook.go:688–694  ·  view source on GitHub ↗

TestWebhook adds the test webhook matches the ID to task queue.

(repo *Repository, event HookEventType, p api.Payloader, webhookID int64)

Source from the content-addressed store, hash-verified

686
687// TestWebhook adds the test webhook matches the ID to task queue.
688func TestWebhook(repo *Repository, event HookEventType, p api.Payloader, webhookID int64) error {
689 webhook, err := GetWebhookOfRepoByID(repo.ID, webhookID)
690 if err != nil {
691 return errors.Newf("GetWebhookOfRepoByID [repo_id: %d, id: %d]: %v", repo.ID, webhookID, err)
692 }
693 return prepareHookTasks(x, repo, event, p, []*Webhook{webhook})
694}
695
696func (t *HookTask) deliver() {
697 payloadURL, err := url.Parse(t.URL)

Callers 1

TestWebhookFunction · 0.92

Calls 2

GetWebhookOfRepoByIDFunction · 0.85
prepareHookTasksFunction · 0.85

Tested by

no test coverage detected