github

package
Version: v0.0.0-...-0f20b9f Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser implements the core.Parser type for GitHub Pull Request

func NewParser

func NewParser(pattern string, secretToken string) Parser

NewParser creates a new parser using the pattern provided

func (Parser) MatchHeaders

func (Parser) MatchHeaders(headers map[string][]string) bool

MatchHeaders indicates that the headers match with the kind of request

func (Parser) Parse

func (p Parser) Parse(headers map[string][]string, payload []byte) (core.Announcement, error)

Parse parses a payload and returns a a valid one if everything is in place for it to be announced

type Payload

type Payload struct {
	Signature   string
	PullRequest PullRequest `json:"pull_request"`
	Repository  Repository  `json:"repository"`
}

Payload wraps a Github pull request

func (Payload) ProjectName

func (pl Payload) ProjectName() string

ProjectName implements Annoucement

func (Payload) ShouldAnnounce

func (pl Payload) ShouldAnnounce() bool

ShouldAnnounce implements Annoucement

func (Payload) Text

func (pl Payload) Text() string

Text implements Annoucement

type PullRequest

type PullRequest struct {
	URL    string `json:"html_url"`
	State  string `json:"state"`
	Title  string `json:"title"`
	Merged bool   `json:"merged"`
	Body   string `json:"body"`
}

PullRequest implements a pull request payload object

type Repository

type Repository struct {
	FullName string `json:"full_name"`
}

Repository holds the repository information

Source Files

Jump to

Keyboard shortcuts

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