Documentation
¶
Overview ¶
Package event defines event types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Change ¶
type Change struct {
Action string // "opened", "closed", "merged", "reopened".
ChangeTitle string
ChangeBody string // Only set when action is "opened".
ChangeHTMLURL string
}
Change is a change event.
type ChangeComment ¶
type ChangeComment struct {
ChangeTitle string
ChangeState state.Change
CommentBody string
CommentReview state.Review
CommentHTMLURL string
}
ChangeComment is a change comment event. A change comment is a review iff CommentReview is non-zero.
type CommitComment ¶
CommitComment is a commit comment event.
type Create ¶
type Create struct {
Type string // "repository", "package", "branch", "tag".
Name string // Only for "branch", "tag" types.
Description string // Only for "repository", "package" types. Optional.
}
Create is a create event.
type Event ¶
type Event struct {
Time time.Time
Actor users.User // UserSpec and Login fields populated.
// Container is the URL (without schema) of event target.
//
// For event types Issue, Change, IssueComment, ChangeComment, CommitComment,
// and Create with "package" type, it's the import path of the target package.
// E.g., "golang.org/x/image/font/sfnt" or "github.com/user/repo/sub/dir".
//
// For all other event types, it is the module path of the target repository.
// E.g., "golang.org/x/image" or "github.com/user/repo".
Container string
// Payload specifies the event type. It's one of:
// Issue, Change, IssueComment, ChangeComment, CommitComment,
// Push, Star, Create, Fork, Delete, Wiki.
Payload interface{}
}
Event represents an event.
func (Event) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*Event) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type Fork ¶
type Fork struct {
Container string // URL (without schema) of the created repository. E.g., "github.com/anotheruser/repo".
}
Fork is a fork event.
type Issue ¶
type Issue struct {
Action string // "opened", "closed", "reopened".
IssueTitle string
IssueBody string // Only set when action is "opened".
IssueHTMLURL string
}
Issue is an issue event.
type IssueComment ¶
type IssueComment struct {
IssueTitle string
IssueState state.Issue
CommentBody string
CommentHTMLURL string
}
IssueComment is an issue comment event.
type Page ¶
type Page struct {
Action string // "created", "edited".
SHA string
Title string
HTMLURL string
CompareHTMLURL string
}
Page describes a page action in a Wiki event.
type Push ¶
type Push struct {
Branch string // Name of branch pushed to. E.g., "master".
Head string // SHA of the most recent commit after the push.
Before string // SHA of the most recent commit before the push.
Commits []Commit // Ordered from earliest to most recent (head).
HeadHTMLURL string // Optional.
BeforeHTMLURL string // Optional.
}
Push is a push event.
Click to show internal directories.
Click to hide internal directories.