Documentation ¶
Overview ¶
Package githubhook provides a HTTP Handler for GitHub webhook.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct { Secret string DecodePayload func(event string, rawPayload []byte) (any, error) Delivery func(event string, deliveryID string, payload any) Error func(err error, req *http.Request) }
Handler is a http.Handler for GitHub webhook.
It supports both JSON and form content types.
Fields (all are optional):
- Secret is the secret defined in GitHub webhook.
- DecodePayload is called to decode payload. If it's not defined, JSON unmarshal is used.
- Delivery is called if a valid delivery is received.
- Error is called if an error happened.
type RequestError ¶
RequestError represents a request error.
func (*RequestError) Error ¶
func (err *RequestError) Error() string
Click to show internal directories.
Click to hide internal directories.