github

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package github provides convenience wrappers around the go-github package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetModifiedFiles(repo models.Repo, pull models.PullRequest) ([]string, error)
	CreateComment(repo models.Repo, pull models.PullRequest, comment string) error
	PullIsApproved(repo models.Repo, pull models.PullRequest) (bool, error)
	GetPullRequest(repo models.Repo, num int) (*github.PullRequest, *github.Response, error)
	UpdateStatus(repo models.Repo, pull models.PullRequest, state string, description string, context string) error
}

type ConcreteClient

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

ConcreteClient is used to perform GitHub actions.

func NewClient

func NewClient(hostname string, user string, pass string) (*ConcreteClient, error)

NewClient returns a valid GitHub client.

func (*ConcreteClient) CreateComment

func (c *ConcreteClient) CreateComment(repo models.Repo, pull models.PullRequest, comment string) error

CreateComment creates a comment on the pull request.

func (*ConcreteClient) GetModifiedFiles

func (c *ConcreteClient) GetModifiedFiles(repo models.Repo, pull models.PullRequest) ([]string, error)

GetModifiedFiles returns the names of files that were modified in the pull request. The names include the path to the file from the repo root, ex. parent/child/file.txt.

func (*ConcreteClient) GetPullRequest

func (c *ConcreteClient) GetPullRequest(repo models.Repo, num int) (*github.PullRequest, *github.Response, error)

GetPullRequest returns the pull request.

func (*ConcreteClient) PullIsApproved

func (c *ConcreteClient) PullIsApproved(repo models.Repo, pull models.PullRequest) (bool, error)

PullIsApproved returns true if the pull request was approved.

func (*ConcreteClient) UpdateStatus

func (c *ConcreteClient) UpdateStatus(repo models.Repo, pull models.PullRequest, state string, description string, context string) error

UpdateStatus updates the status badge on the pull request. See https://github.com/blog/1227-commit-status-api.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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