1
0
Fork 0
forked from forgejo/forgejo

[FEAT] sourcehut webhooks

This commit is contained in:
oliverpool 2024-03-13 16:49:48 +01:00
parent 04a398a1af
commit ed9dd0e62a
28 changed files with 890 additions and 13 deletions

View file

@ -9,6 +9,7 @@ import (
"crypto/sha1"
"crypto/sha256"
"encoding/hex"
"errors"
"fmt"
"io"
"net/http"
@ -19,6 +20,8 @@ import (
webhook_module "code.gitea.io/gitea/modules/webhook"
)
var ErrPayloadTypeNotSupported = errors.New("unsupported webhook event")
// PayloadConvertor defines the interface to convert system payload to webhook payload
type PayloadConvertor[T any] interface {
Create(*api.CreatePayload) (T, error)