Skip to content

Commit 1e0ece4

Browse files
Dean KarnDean Karn
authored andcommitted
cleanup imports + README for v2
1 parent 60d6ca1 commit 1e0ece4

File tree

7 files changed

+26
-23
lines changed

7 files changed

+26
-23
lines changed

README.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Library webhooks
22
================
3-
<img align="right" src="https://raw.githubusercontent.com/go-playground/webhooks/v1/logo.png">
4-
![Project status](https://img.shields.io/badge/version-1.0-green.svg)
3+
<img align="right" src="https://raw.githubusercontent.com/go-playground/webhooks/v2/logo.png">
4+
![Project status](https://img.shields.io/badge/version-2.0.0-green.svg)
55
[![Build Status](https://semaphoreci.com/api/v1/projects/5b9e2eda-8f8d-40aa-8cb4-e3f6120171fe/587820/badge.svg)](https://semaphoreci.com/joeybloggs/webhooks)
6-
[![Coverage Status](https://coveralls.io/repos/go-playground/webhooks/badge.svg?branch=v1&service=github)](https://coveralls.io/github/go-playground/webhooks?branch=v1)
6+
[![Coverage Status](https://coveralls.io/repos/go-playground/webhooks/badge.svg?branch=v2&service=github)](https://coveralls.io/github/go-playground/webhooks?branch=v2)
77
[![Go Report Card](https://goreportcard.com/badge/go-playground/webhooks)](https://goreportcard.com/report/go-playground/webhooks)
8-
[![GoDoc](https://godoc.org/gopkg.in/go-playground/webhooks.v1?status.svg)](https://godoc.org/gopkg.in/go-playground/webhooks.v1)
8+
[![GoDoc](https://godoc.org/gopkg.in/go-playground/webhooks.v2?status.svg)](https://godoc.org/gopkg.in/go-playground/webhooks.v2)
99
![License](https://img.shields.io/dub/l/vibe-d.svg)
1010

1111
Library webhooks allows for easy recieving and parsing of GitHub & Bitbucket Webhook Events
@@ -24,20 +24,18 @@ Installation
2424

2525
Use go get.
2626

27-
go get gopkg.in/go-playground/webhooks.v1
28-
29-
or to update
30-
31-
go get -u gopkg.in/go-playground/webhooks.v1
27+
```shell
28+
go get -u gopkg.in/go-playground/webhooks.v2
29+
```
3230

3331
Then import the validator package into your own code.
3432

35-
import "gopkg.in/go-playground/webhooks.v1"
33+
import "gopkg.in/go-playground/webhooks.v2"
3634

3735
Usage and documentation
3836
------
3937

40-
Please see http://godoc.org/gopkg.in/go-playground/webhooks.v1 for detailed usage docs.
38+
Please see http://godoc.org/gopkg.in/go-playground/webhooks.v2 for detailed usage docs.
4139

4240
##### Examples:
4341

@@ -49,8 +47,8 @@ import (
4947
"fmt"
5048
"strconv"
5149

52-
"gopkg.in/go-playground/webhooks.v1"
53-
"gopkg.in/go-playground/webhooks.v1/github"
50+
"gopkg.in/go-playground/webhooks.v2"
51+
"gopkg.in/go-playground/webhooks.v2/github"
5452
)
5553

5654
const (
@@ -59,6 +57,7 @@ const (
5957
)
6058

6159
func main() {
60+
6261
hook := github.New(&github.Config{Secret: "MyGitHubSuperSecretSecrect...?"})
6362
hook.RegisterEvents(HandleRelease, github.ReleaseEvent)
6463
hook.RegisterEvents(HandlePullRequest, github.PullRequestEvent)
@@ -95,6 +94,7 @@ func HandlePullRequest(payload interface{}, header webhooks.Header) {
9594
// Do whatever you want from here...
9695
fmt.Printf("%+v", pl)
9796
}
97+
9898
```
9999

100100
Single receiver for events you subscribe to
@@ -105,8 +105,8 @@ import (
105105
"fmt"
106106
"strconv"
107107

108-
"gopkg.in/go-playground/webhooks.v1"
109-
"gopkg.in/go-playground/webhooks.v1/github"
108+
"gopkg.in/go-playground/webhooks.v2"
109+
"gopkg.in/go-playground/webhooks.v2/github"
110110
)
111111

112112
const (
@@ -115,6 +115,7 @@ const (
115115
)
116116

117117
func main() {
118+
118119
hook := github.New(&github.Config{Secret: "MyGitHubSuperSecretSecrect...?"})
119120
hook.RegisterEvents(HandleMultiple, github.ReleaseEvent, github.PullRequestEvent) // Add as many as you want
120121

bitbucket/bitbucket.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"io/ioutil"
66
"net/http"
77

8-
"gopkg.in/go-playground/webhooks.v1"
8+
"gopkg.in/go-playground/webhooks.v2"
99
)
1010

1111
// Webhook instance contains all methods needed to process events

bitbucket/bitbucket_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"time"
1010

1111
. "gopkg.in/go-playground/assert.v1"
12-
"gopkg.in/go-playground/webhooks.v1"
12+
"gopkg.in/go-playground/webhooks.v2"
1313
)
1414

1515
// NOTES:

examples/multiple-handlers/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"fmt"
55
"strconv"
66

7-
"gopkg.in/go-playground/webhooks.v1"
8-
"gopkg.in/go-playground/webhooks.v1/github"
7+
"gopkg.in/go-playground/webhooks.v2"
8+
"gopkg.in/go-playground/webhooks.v2/github"
99
)
1010

1111
const (
@@ -14,6 +14,7 @@ const (
1414
)
1515

1616
func main() {
17+
1718
hook := github.New(&github.Config{Secret: "MyGitHubSuperSecretSecrect...?"})
1819
hook.RegisterEvents(HandleRelease, github.ReleaseEvent)
1920
hook.RegisterEvents(HandlePullRequest, github.PullRequestEvent)

examples/single-handler/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"fmt"
55
"strconv"
66

7-
"gopkg.in/go-playground/webhooks.v1"
8-
"gopkg.in/go-playground/webhooks.v1/github"
7+
"gopkg.in/go-playground/webhooks.v2"
8+
"gopkg.in/go-playground/webhooks.v2/github"
99
)
1010

1111
const (
@@ -14,6 +14,7 @@ const (
1414
)
1515

1616
func main() {
17+
1718
hook := github.New(&github.Config{Secret: "MyGitHubSuperSecretSecrect...?"})
1819
hook.RegisterEvents(HandleMultiple, github.ReleaseEvent, github.PullRequestEvent) // Add as many as you want
1920

github/github.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"io/ioutil"
99
"net/http"
1010

11-
"gopkg.in/go-playground/webhooks.v1"
11+
"gopkg.in/go-playground/webhooks.v2"
1212
)
1313

1414
// Webhook instance contains all methods needed to process events

github/github_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"time"
1010

1111
. "gopkg.in/go-playground/assert.v1"
12-
"gopkg.in/go-playground/webhooks.v1"
12+
"gopkg.in/go-playground/webhooks.v2"
1313
)
1414

1515
// NOTES:

0 commit comments

Comments
 (0)