client.go
func (c *Client) Webhook(header http.Header, body []byte) (*Webhook, error) {
	for _, token := range header["X-Pusher-Key"] {
		if token == c.Key && checkSignature(header.Get("X-Pusher-Signature"), c.Secret, body) {
			unmarshalledWebhooks, err := unmarshalledWebhook(body)
			if err != nil {
				return unmarshalledWebhooks, err
			}
			decryptedWebhooks, err := decryptEvents(*unmarshalledWebhooks, c.EncryptionMasterKey)
			return decryptedWebhooks, err
		}
	}
	return nil, errors.New("Invalid webhook")
}
func (c *Client) Webhook(header http.Header, body []byte) (*Webhook, error) {
	for _, token := range header["X-Pusher-Key"] {
		if token == c.Key && checkSignature(header.Get("X-Pusher-Signature"), c.Secret, body) {
			unmarshalledWebhooks, err := unmarshalledWebhook(body)
			if err != nil {
				return unmarshalledWebhooks, err
			}
			decryptedWebhooks, err := decryptEvents(*unmarshalledWebhooks, c.EncryptionMasterKey)
			return decryptedWebhooks, err
		}
	}
	return nil, errors.New("Invalid webhook")
}
/*
On your dashboard at http://app.pusher.com, you can set up webhooks to POST
a payload to your server after certain events. Such events include channels
being occupied or vacated, members being added or removed in presence-channels,
or after client-originated events. For more information see https://pusher.com/docs/webhooks.

This library provides a mechanism for checking that these POST
requests are indeed from Pusher, by checking the token and
authentication signature in the header of the request.

If the webhook is valid, a `*pusher.Webhook* will be returned, and the `err` value will be nil.
If it is invalid, the first return value will be nil, and an error will be passed.

	func pusherWebhook(res http.ResponseWriter, req *http.Request) {

		body, _ := ioutil.ReadAll(req.Body)
		webhook, err := client.Webhook(req.Header, body)
	  	if err != nil {
	      fmt.Println("Webhook is invalid :(")
	  	} else {
	      fmt.Printf("%+v\n", webhook.Events)
	  	}

	}
*/