pull

package module
v0.0.0-...-425d40c Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2015 License: MIT Imports: 9 Imported by: 2 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Logo Pull

Travis Build Coverage License Documentation Chat

A pull request checker library for Go.

❗ Still in heavy development. Not everything in this document is accurate. Please wait for the 0.1 release ❗

Example

handler := pull.New(
    pull.Configuration{
        Middlewares: pull.Middlewares{
            "reopened": {
                signed.Signed,
                changelog.New("CHANGELOG.md")},
            "opened": {
                deny.New("We do not accept pull requests!")}},
    })

http.Handle("/webhook", handler)
log.Fatal(http.ListenAndServe(":8080", nil))

Installation

Install with go get

  go get github.com/hansrodtang/pull

For those who prefer stable releases, you can also use gopkg.in:

  go get gopkg.in/hansrodtang/pull.v0

License

This software is licensed under the MIT license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Data

func Data(req *github.PullRequest) (user string, repository string, number int)

func Failure

func Failure(url string, desc string, c string) *github.RepoStatus

func Success

func Success(url string, desc string, c string) *github.RepoStatus

Types

type Configuration

type Configuration struct {
	Client      *http.Client
	Middlewares Middlewares
	Secret      string
}

type Handler

type Handler struct {
	Client *github.Client
	*Configuration
}

func New

func New(c Configuration) *Handler

func (*Handler) ServeHTTP

func (l *Handler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type Middleware

type Middleware func(*github.Client, *github.PullRequest)

type Middlewares

type Middlewares map[string][]Middleware

Directories

Path Synopsis
handlers
cla

Jump to

Keyboard shortcuts

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