import "github.com/ubclaunchpad/inertia/daemon/inertiad/webhook"
Package webhook contains Inertia's webhook parsing code
bitbucket.go bitbucket_push.go doc.go docker.go github.go github_push.go gitlab.go gitlab_push.go parse.go verify.go
const ( PushEvent EventType = "push" PullEvent EventType = "pull" PingEvent EventType = "ping" // Hosts GitHub = "github" GitLab = "gitlab" BitBucket = "bitbucket" )
Constants for the generic webhook interface
var ( GithubPingHeader = "ping" GithubPushHeader = "push" )
x-github-event header values
var (
BitbucketPushHeader = "repo:push"
)
x-event-key header values
var (
GitlabPushHeader = "Push Hook"
)
x-gitlab-event header values
Type returns the git host and event header of given webhook request
Verify ensures the payload's integrity and returns and error if anything doesn't match up
type DockerWebhook struct {
// contains filtered or unexported fields
}
DockerWebhook represents a push to DockerHub see https://docs.docker.com/docker-hub/webhooks/
func ParseDocker(r *http.Request) (*DockerWebhook, error)
ParseDocker takes in a Docker webhook request and parses it
func (d *DockerWebhook) GetName() string
GetName returns the namespace
func (d *DockerWebhook) GetOwner() string
GetOwner returns the repository owner
func (d *DockerWebhook) GetPusher() string
GetPusher returns the user that pushed to DockerHub
func (d *DockerWebhook) GetRepoName() string
GetRepoName returns the full repository name
func (d *DockerWebhook) GetTag() string
GetTag returns the tag that was pushed to DockerHub
EventType denotes types of webhook events
type Payload interface { GetSource() string GetEventType() EventType GetRepoName() string GetRef() string GetGitURL() string GetSSHURL() string }
Payload represents a generic webhook payload
Parse takes in a webhook request and parses it into one of the supported types
Package webhook imports 7 packages (graph) and is imported by 1 packages. Updated 2019-02-28. Refresh now. Tools for package owners.