MCPcopy Index your code
hub / github.com/gogs/gogs / createHookTask

Function createHookTask

internal/database/webhook.go:511–520  ·  view source on GitHub ↗

createHookTask creates a new hook task, it handles conversion from Payload to PayloadContent.

(e Engine, t *HookTask)

Source from the content-addressed store, hash-verified

509// createHookTask creates a new hook task,
510// it handles conversion from Payload to PayloadContent.
511func createHookTask(e Engine, t *HookTask) error {
512 data, err := t.JSONPayload()
513 if err != nil {
514 return err
515 }
516 t.UUID = gouuid.NewV4().String()
517 t.PayloadContent = string(data)
518 _, err = e.Insert(t)
519 return err
520}
521
522var _ errutil.NotFound = (*ErrHookTaskNotExist)(nil)
523

Callers 1

prepareHookTasksFunction · 0.85

Calls 4

stringFunction · 0.85
InsertMethod · 0.80
JSONPayloadMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected