Categorygithub.com/robekeane/webhooks

# README

Library webhooks with Gitee support

Project status Test Coverage Status Go Report Card GoDoc License

Thanks for go-playground/webhooks, this is a fork project to add gitee support.

Installation

Use go get.

go get -u github.com/robekeane/webhooks/v6

Then import the package into your own code.

import "github.com/robekeane/webhooks/v6"

Usage and Documentation

Please see http://godoc.org/github.com/go-playground/webhooks/v6 for detailed usage docs.

Examples:
package main

import (
	"fmt"

	"net/http"

	"github.com/robekeane/webhooks/v6/gitee"
)

const (
	path = "/webhooks"
)

func main() {
	hook, _ := gitee.New(gitee.Options.Secret("test12345"))

	http.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) {
		payload, err := hook.Parse(r, gitee.IssuesEvents)
		if err != nil {
			if err == gitee.ErrEventNotFound {
			}
		}
		switch payload.(type) {

		case gitee.IssueEventPayload:
			release := payload.(gitee.IssueEventPayload)
			fmt.Printf("%+v", release.Issue.Title)
		}
	})
	http.ListenAndServe(":3000", nil)
}


License

Distributed under MIT License, please see license file in code for more details.

# Packages

No description provided by the author