Documentation ¶
Index ¶
Constants ¶
const ( EventActionOpened = "opened" EventActionClosed = "closed" EventActionReopened = "reopened" )
SupportedPullRequestActions defines all pull request event actions which are supported by this app.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticatedGithubClient ¶
type AuthenticatedGithubClient struct { Client *gh.Client // contains filtered or unexported fields }
AuthenticatedGithubClient abstracts the github client from google's client
func NewAuthenticatedGithubClient ¶
func NewAuthenticatedGithubClient(accessToken string) *AuthenticatedGithubClient
NewAuthenticatedGithubClient produces a new, authenticated github client
func (*AuthenticatedGithubClient) CreateComment ¶
func (agc *AuthenticatedGithubClient) CreateComment(owner string, repo string, issueNumber int, body string) (*gh.IssueComment, error)
CreateComment creates a new comment on github
type Client ¶
type Client interface {
CreateComment(owner string, repo string, issueNumber int, body string) (*gh.IssueComment, error)
}
Client defines the interface for a github client
type Event ¶
type Event struct { Action string IssueNumber int RepositoryName string RepositoryFullname string RepositoryOwner string HeadRef string Type EventType OriginalEvent interface{} }
Event is the internal structure used for an event
func ConvertGithubEvent ¶
ConvertGithubEvent turns an original Github Event into the internal structure
type WebhookParser ¶
type WebhookParser struct {
Secret string
}
WebhookParser is responsible for parsing data from github into internal structs
func NewWebhookParser ¶
func NewWebhookParser(secret string) *WebhookParser
NewWebhookParser returns an initialized WebhookParser
func (*WebhookParser) ValidateAndParseWebhook ¶
func (p *WebhookParser) ValidateAndParseWebhook(request *http.Request) (interface{}, error)
ValidateAndParseWebhook validates a request from github against the token and also parses the data into an internal event struct