hooker

package
v0.0.0-...-9585af7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package hooker can generate github webhooks. It's only real use is for testing endpoints that handle github webhooks.

Index

Constants

This section is empty.

Variables

View Source
var DefaultPing = events.Ping{
	Zen: "Practicality beats purity.",
}

DefaultPing is a Ping event that makes you feel good.

Functions

This section is empty.

Types

type Client

type Client struct {
	// Secret is a secret to sign request bodies with.
	Secret string

	// URL is the url to make requests against.
	URL string
	// contains filtered or unexported fields
}

Client represents a client that can send GitHub webhooks.

func NewClient

func NewClient(c *http.Client) *Client

NewClient returns a new Client instance.

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

Do performs the request.

func (*Client) Ping

func (c *Client) Ping(p events.Ping) (*http.Response, error)

Ping sends a ping event.

func (*Client) Trigger

func (c *Client) Trigger(event string, v interface{}) (*http.Response, error)

Trigger triggers a webhook event. The sha1 digest of v is calculated and including in the X-Hub-Signature header.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL