webhooks.v2: gopkg.in/go-playground/webhooks.v2 Index | Files | Directories

package webhooks

import "gopkg.in/go-playground/webhooks.v2"

Index

Package Files

webhooks.go

func Run Uses

func Run(hook Webhook, addr string, path string) error

Run runs a server

func RunServer Uses

func RunServer(s *http.Server, hook Webhook, path string) error

RunServer runs a custom server.

func RunTLSServer Uses

func RunTLSServer(s *http.Server, hook Webhook, path string) error

RunTLSServer runs a custom server with TLS configuration. NOTE: http.Server Handler will be overridden by this library, just set it to nil. Setting the Certificates can be done in the http.Server.TLSConfig.Certificates see example here: https://github.com/go-playground/webhooks/blob/v2/webhooks_test.go#L178

type Header http.Header

Header provides http.Header to minimize imports

type ProcessPayloadFunc Uses

type ProcessPayloadFunc func(payload interface{}, header Header)

ProcessPayloadFunc is a common function for payload return values

type Provider Uses

type Provider int

Provider defines the type of webhook

const (
    GitHub Provider = iota
    Bitbucket
    GitLab
)

webhooks available providers

func (Provider) String Uses

func (p Provider) String() string

type Webhook Uses

type Webhook interface {
    Provider() Provider
    ParsePayload(w http.ResponseWriter, r *http.Request)
}

Webhook interface defines a webhook to recieve events

Directories

PathSynopsis
bitbucket
github
gitlab

Package webhooks imports 1 packages (graph) and is imported by 4 packages. Updated 2017-04-08. Refresh now. Tools for package owners.