Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
func Handler(secret string, l logger.Logger, fn WebHookHandler) http.HandlerFunc
func HashPayload ¶
HashPayload computes the hash of payload's body according to the webhook's secret token see https://developer.github.com/webhooks/securing/#validating-payloads-from-github returning the hash as a hexadecimal string
func IsValidPayload ¶
IsValidPayload checks if the github payload's hash fits with the hash computed by GitHub sent as a header
Types ¶
type GitHubRepo ¶
type GitHubRepo struct { Name string // repository name FullName string // repository full name CloneURL string // repository url CommitID string // push commit id CommitName string // push repo name CommitEmail string // push repo email CommitAt string // push time BranchName string // branch name }
repo info
type PayloadPong ¶
type WebHookHandler ¶
type WebHookHandler func(eventName string, payload *GitHubRepo, req *http.Request) error
Click to show internal directories.
Click to hide internal directories.