Documentation
¶
Index ¶
Constants ¶
View Source
const ( GITHUB_API = "https://api.github.com/users/%s/events" TRUNC_LEN = 32 )
View Source
const ( ACT_ADDED string = "addded" ACT_ASSIGNED Action = "assigned" ACT_CLOSED Action = "closed" ACT_CREATED Action = "created" ACT_DELETED Action = "deleted" ACT_DEQUEUED Action = "dequeued" ACT_EDITED Action = "edited" ACT_LABELED Action = "labeled" ACT_OPENED Action = "opened" ACT_PUBLISHED Action = "published" ACT_REOPENED Action = "reopened" ACT_RESOLVED Action = "resolved" ACT_REVIEW_REQUESTED Action = "review_requested" ACT_REVIEW_REQUEST_REMOVED Action = "review_request_removed" ACT_SYNCHRONIZE Action = "synchronize" ACT_UNASSIGNED Action = "unassigned" ACT_UNLABELED Action = "unlabeled" ACT_UNRESOLVED Action = "unresolved" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Commit ¶
type Commit struct {
Message string `json:"message"`
SHA string `json:"string"`
Author Author `json:"author"`
Distinct bool `json:"distinct"`
}
A commit
type Event ¶
type Event struct {
Type EventType `json:"type"`
Repo Repo `json:"repo"`
Payload Payload `json:"payload"`
}
Represents a Github Event
This doesn't actually hold all of the data that is received, only the data relevant to us
type EventPrinter ¶
type EventPrinter func(Event)
type EventType ¶
type EventType string
All possible events the API can provide us
const ( COMMIT_COMMENT_EVENT EventType = "CommitCommentEvent" CREATE_EVENT EventType = "CreateEvent" DELETE_EVENT EventType = "DeleteEvent" FORK_EVENT EventType = "ForkEvent" GOLLUM_EVENT EventType = "GollumEvent" ISSUE_COMMENT_EVENT EventType = "IssueCommentEvent" ISSUES_EVENT EventType = "IssuesEvent" MEMBER_EVENT EventType = "MemberEvent" PUBLIC_EVENT EventType = "PublicEvent" PULL_REQUEST_EVENT EventType = "PullRequestEvent" PULL_REQUEST_REVIEW_EVENT EventType = "PullRequestReviewEvent" PULL_REQUEST_REVIEW_COMMENT_EVENT EventType = "PullRequestReviewCommentEvent" PULL_REQUEST_REVIEW_THREAD_EVENT EventType = "PullRequestReviewThreadEvent" PUSH_EVENT EventType = "PushEvent" RELEASE_EVENT EventType = "ReleaseEvent" SPONSORSHIP_EVENT EventType = "SponsorshipEvent" WATCH_EVENT EventType = "WatchEvent" )
type Issue ¶
type Issue struct {
Number json.Number `json:"number"`
Title string `json:"title"`
State string `json:"state"`
User User `json:"login"`
}
An issue
type Page ¶
type Page struct {
PageName string `json:"page_name"`
Title string `json:"title"`
Action Action `json:"action"`
HTMLUrl string `json:"html_url"`
}
Represents a wiki Page
type Payload ¶
type Payload struct {
Action Action `json:"action"`
Ref string `json:"ref"`
Assignee User `json:"assignee"`
Member User `json:"member"`
Reason string `json:"reason"`
Release Release `json:"release"`
Size json.Number `json:"size"`
Forkee Repo `json:"forkee"`
RefType RefType `json:"ref_type"`
Comment Comment `json:"comment"`
Review Review `json:"review"`
PullRequest PullRequest `json:"pull_request"`
Issue Issue `json:"issue"`
Pages []Page `json:"pages"`
Commits []Commit `json:"commits"`
}
Represents the actual important data in an event
This varies a lot (*A LOT* a lot) from event to event, so make sure to check the EventType value in the Event to make sure you're accessing the correct payload data
type PullRequest ¶
type PullRequest struct {
Number json.Number `json:"number"`
Title string `json:"title"`
State string `json:"state"`
User User `json:"login"`
}
A PR
func (PullRequest) String ¶
func (pr PullRequest) String() string
Click to show internal directories.
Click to hide internal directories.