github

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGithubClient

func NewGithubClient(token string) *github.Client

NewGithubClient creates a new GitHub client.

Types

type GHClient

type GHClient struct {
	GitHubClient *github.Client
	GitHubSecret string
	// contains filtered or unexported fields
}

GHClient set the confiuration needed.

func NewGitHubConfig

func NewGitHubConfig(gitHubToken, gitHubSecret string, logger log.FieldLogger) *GHClient

NewGitHubConfig creates a new KopsProvisioner.

func (*GHClient) AddLabels

func (g *GHClient) AddLabels(org, repo string, number int, labels []string) error

AddLabels adds a GitHub label to a specific issue/pull request.

func (*GHClient) CreateComment

func (g *GHClient) CreateComment(org, repo string, number int, comment string)

CreateComment sends a GitHub Comment to a specific issue/pull request.

func (*GHClient) GetComments

func (g *GHClient) GetComments(org, repo string, number int) ([]*github.IssueComment, error)

GetComments get comments a specific issue/pull request.

func (*GHClient) GetIssueLabels

func (g *GHClient) GetIssueLabels(org, repo string, number int) ([]*github.Label, error)

GetIssueLabels get all the labels for a specific issue/pull request.

func (*GHClient) GetPullRequest

func (g *GHClient) GetPullRequest(org, repo string, number int) (*github.PullRequest, error)

GetPullRequest get a Pull Request

func (*GHClient) IsMember

func (g *GHClient) IsMember(org, user string) (bool, error)

IsMember check if a user is member of the org

func (*GHClient) ListIssueComments

func (g *GHClient) ListIssueComments(org, repo string, number int) ([]*github.IssueComment, error)

ListIssueComments get all the comment for a specific issue/pull request.

func (*GHClient) ListRepoLabels

func (g *GHClient) ListRepoLabels(org, repo string) ([]*github.Label, error)

ListRepoLabels list all labels for a repo

func (*GHClient) RemoveLabel

func (g *GHClient) RemoveLabel(org, repo string, number int, label string) error

RemoveLabel remove a GitHub label from a specific issue/pull request.

func (*GHClient) SetStatus

func (g *GHClient) SetStatus(org, repo, sha, state, message string) error

SetStatus set the PR status

func (*GHClient) ValidateSignature

func (g *GHClient) ValidateSignature(receivedHash []string, bodyBuffer []byte) error

ValidateSignature validate the incoming github event.

Jump to

Keyboard shortcuts

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