Documentation ¶
Index ¶
- type AuthorLogin
- type Command
- type CommandArguments
- type CommandName
- type Comment
- func (c *Comment) AppendComment(comments []*github.IssueComment) []*github.IssueComment
- func (c *Comment) AppendEvent(events []*github.IssueEvent) []*github.IssueEvent
- func (c *Comment) AppendReviewComment(reviews []*github.PullRequestComment) []*github.PullRequestComment
- func (c *Comment) Date() *time.Time
- func (c *Comment) Match(matcher Matcher) bool
- type CreatedAfter
- type CreatedBefore
- type Event
- func (e *Event) AppendComment(comments []*github.IssueComment) []*github.IssueComment
- func (e *Event) AppendEvent(events []*github.IssueEvent) []*github.IssueEvent
- func (e *Event) AppendReviewComment(reviews []*github.PullRequestComment) []*github.PullRequestComment
- func (e *Event) Date() *time.Time
- func (e *Event) Match(matcher Matcher) bool
- type Item
- type Items
- func (i Items) AddComments(comments ...*github.IssueComment) Items
- func (i Items) AddEvents(events ...*github.IssueEvent) Items
- func (i Items) AddReviewComments(reviews ...*github.PullRequestComment) Items
- func (i Items) Comments() []*github.IssueComment
- func (i Items) Events() []*github.IssueEvent
- func (i Items) Filter(matcher Matcher) Items
- func (i Items) FirstDate(deflt *time.Time) *time.Time
- func (i Items) GetFirst() Item
- func (i Items) GetLast() Item
- func (i Items) IsEmpty() bool
- func (i Items) LastDate(deflt *time.Time) *time.Time
- func (i Items) Len() int
- func (i Items) Less(x, y int) bool
- func (i Items) ReviewComments() []*github.PullRequestComment
- func (i Items) Swap(x, y int)
- type LabelName
- type LabelPrefix
- type Matcher
- func AddLabel() Matcher
- func And(matchers ...Matcher) Matcher
- func AuthorLogins(authors ...string) Matcher
- func AuthorUsers(users ...*github.User) Matcher
- func BotAuthor(mungeBotName string) Matcher
- func CommentType() Matcher
- func EventType() Matcher
- func False() Matcher
- func HumanActor(mungeBotName string) Matcher
- func JenkinsBotAuthor() Matcher
- func MungerNotificationName(notif, mungeBotName string) Matcher
- func Not(matcher Matcher) Matcher
- func Or(matchers ...Matcher) Matcher
- func ReviewCommentType() Matcher
- func True() Matcher
- func ValidAuthor() Matcher
- type Notification
- type NotificationName
- type Pinger
- func (p *Pinger) IsMaxReached(comments []*github.IssueComment, startDate *time.Time) bool
- func (p *Pinger) PingNotification(comments []*github.IssueComment, who string, startDate *time.Time) *Notification
- func (p *Pinger) SetDescription(description string) *Pinger
- func (p *Pinger) SetMaxCount(maxCount int) *Pinger
- func (p *Pinger) SetTimePeriod(timePeriod time.Duration) *Pinger
- type ReviewComment
- func (r *ReviewComment) AppendComment(comments []*github.IssueComment) []*github.IssueComment
- func (r *ReviewComment) AppendEvent(events []*github.IssueEvent) []*github.IssueEvent
- func (r *ReviewComment) AppendReviewComment(reviews []*github.PullRequestComment) []*github.PullRequestComment
- func (r *ReviewComment) Date() *time.Time
- func (r *ReviewComment) Match(matcher Matcher) bool
- type UpdatedAfter
- type UpdatedBefore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorLogin ¶
type AuthorLogin string
func (AuthorLogin) MatchComment ¶
func (a AuthorLogin) MatchComment(comment *github.IssueComment) bool
func (AuthorLogin) MatchEvent ¶
func (a AuthorLogin) MatchEvent(event *github.IssueEvent) bool
func (AuthorLogin) MatchReviewComment ¶
func (a AuthorLogin) MatchReviewComment(review *github.PullRequestComment) bool
type Command ¶
Command is a way for human to interact with the bot
func ParseCommands ¶
func ParseCommands(comment *github.IssueComment) []*Command
ParseCommands attempts to read a command from a comment Returns nil if the comment doesn't contain a command
type CommandArguments ¶
CommandArguments identifies commands by arguments (with regex)
func (*CommandArguments) MatchComment ¶
func (c *CommandArguments) MatchComment(comment *github.IssueComment) bool
Match if the comment contains a command whose arguments match the regexp
func (*CommandArguments) MatchEvent ¶
func (*CommandArguments) MatchEvent(evnet *github.IssueEvent) bool
func (*CommandArguments) MatchReviewComment ¶
func (*CommandArguments) MatchReviewComment(review *github.PullRequestComment) bool
type CommandName ¶
type CommandName string
CommandName identifies commands by name
func (CommandName) MatchComment ¶
func (c CommandName) MatchComment(comment *github.IssueComment) bool
Match if the comment contains a command with the given name
func (CommandName) MatchEvent ¶
func (CommandName) MatchEvent(event *github.IssueEvent) bool
func (CommandName) MatchReviewComment ¶
func (CommandName) MatchReviewComment(review *github.PullRequestComment) bool
type Comment ¶
type Comment github.IssueComment
func (*Comment) AppendComment ¶
func (c *Comment) AppendComment(comments []*github.IssueComment) []*github.IssueComment
func (*Comment) AppendEvent ¶
func (c *Comment) AppendEvent(events []*github.IssueEvent) []*github.IssueEvent
func (*Comment) AppendReviewComment ¶
func (c *Comment) AppendReviewComment(reviews []*github.PullRequestComment) []*github.PullRequestComment
type CreatedAfter ¶
CreatedAfter matches comments created after the time
func (CreatedAfter) MatchComment ¶
func (c CreatedAfter) MatchComment(comment *github.IssueComment) bool
MatchComment returns true if the comment is created after the time
func (CreatedAfter) MatchEvent ¶
func (c CreatedAfter) MatchEvent(event *github.IssueEvent) bool
MatchEvent returns true if the event is created after the time
func (CreatedAfter) MatchReviewComment ¶
func (c CreatedAfter) MatchReviewComment(review *github.PullRequestComment) bool
MatchReviewComment returns true if the review comment is created after the time
type CreatedBefore ¶
CreatedBefore matches Items created before the time
func (CreatedBefore) MatchComment ¶
func (c CreatedBefore) MatchComment(comment *github.IssueComment) bool
MatchComment returns true if the comment is created before the time
func (CreatedBefore) MatchEvent ¶
func (c CreatedBefore) MatchEvent(event *github.IssueEvent) bool
MatchEvent returns true if the event is created before the time
func (CreatedBefore) MatchReviewComment ¶
func (c CreatedBefore) MatchReviewComment(review *github.PullRequestComment) bool
MatchReviewComment returns true if the review comment is created before the time
type Event ¶
type Event github.IssueEvent
func (*Event) AppendComment ¶
func (e *Event) AppendComment(comments []*github.IssueComment) []*github.IssueComment
func (*Event) AppendEvent ¶
func (e *Event) AppendEvent(events []*github.IssueEvent) []*github.IssueEvent
func (*Event) AppendReviewComment ¶
func (e *Event) AppendReviewComment(reviews []*github.PullRequestComment) []*github.PullRequestComment
type Item ¶
type Item interface { Match(matcher Matcher) bool Date() *time.Time AppendEvent(events []*github.IssueEvent) []*github.IssueEvent AppendComment(comments []*github.IssueComment) []*github.IssueComment AppendReviewComment(comments []*github.PullRequestComment) []*github.PullRequestComment }
type Items ¶
type Items []Item
func (Items) AddComments ¶
func (i Items) AddComments(comments ...*github.IssueComment) Items
AddComments returns a new list with the added comments
func (Items) AddEvents ¶
func (i Items) AddEvents(events ...*github.IssueEvent) Items
AddEvents returns a new list with the added events
func (Items) AddReviewComments ¶
func (i Items) AddReviewComments(reviews ...*github.PullRequestComment) Items
AddReviewComments returns a new list with the added review comments
func (Items) Comments ¶
func (i Items) Comments() []*github.IssueComment
Comments returns the comments from the list
func (Items) Events ¶
func (i Items) Events() []*github.IssueEvent
Events returns the events from the list
func (Items) FirstDate ¶
FirstDate returns the date of the first matching event, or deflt if no match
func (Items) ReviewComments ¶
func (i Items) ReviewComments() []*github.PullRequestComment
ReviewComments returns the review comments from the list
type LabelName ¶
type LabelName string
LabelName searches for event whose label starts with the string
func (LabelName) MatchComment ¶
func (l LabelName) MatchComment(comment *github.IssueComment) bool
func (LabelName) MatchEvent ¶
func (l LabelName) MatchEvent(event *github.IssueEvent) bool
Match if the label starts with the string
func (LabelName) MatchReviewComment ¶
func (l LabelName) MatchReviewComment(review *github.PullRequestComment) bool
type LabelPrefix ¶
type LabelPrefix string
LabelPrefix searches for event whose label starts with the string
func (LabelPrefix) MatchComment ¶
func (l LabelPrefix) MatchComment(comment *github.IssueComment) bool
func (LabelPrefix) MatchEvent ¶
func (l LabelPrefix) MatchEvent(event *github.IssueEvent) bool
Match if the label starts with the string
func (LabelPrefix) MatchReviewComment ¶
func (l LabelPrefix) MatchReviewComment(review *github.PullRequestComment) bool
type Matcher ¶
type Matcher interface { MatchEvent(event *github.IssueEvent) bool MatchComment(comment *github.IssueComment) bool MatchReviewComment(comment *github.PullRequestComment) bool }
Matcher matches against a comment or an event
func AuthorLogins ¶
func AuthorUsers ¶
func CommentType ¶
func CommentType() Matcher
func HumanActor ¶
HumanActor creates a matcher to find non-bot comments. ValidAuthor is used because a comment that doesn't have "Author" is NOT made by a human
func JenkinsBotAuthor ¶
func JenkinsBotAuthor() Matcher
JenkinsBotAuthor creates a matcher to find jenkins bot comments
func MungerNotificationName ¶
MungerNotificationName finds notification posted by the munger, based on name
func ReviewCommentType ¶
func ReviewCommentType() Matcher
func ValidAuthor ¶
func ValidAuthor() Matcher
type Notification ¶
Notification is a message sent by the bot. Easy to find and create.
func ParseNotification ¶
func ParseNotification(comment *github.IssueComment) *Notification
ParseNotification attempts to read a notification from a comment Returns nil if the comment doesn't contain a notification Also note that Context is not parsed from the notification
func (Notification) Post ¶
func (n Notification) Post(obj *mgh.MungeObject) error
Post a new notification on Github
func (*Notification) String ¶
func (n *Notification) String() string
String converts the notification
type NotificationName ¶
type NotificationName string
NotificationName identifies notifications by name
func (NotificationName) MatchComment ¶
func (b NotificationName) MatchComment(comment *github.IssueComment) bool
Match returns true if the comment is a notification with the given name
func (NotificationName) MatchEvent ¶
func (NotificationName) MatchEvent(event *github.IssueEvent) bool
func (NotificationName) MatchReviewComment ¶
func (b NotificationName) MatchReviewComment(review *github.PullRequestComment) bool
Match returns true if the comment is a notification with the given name
type Pinger ¶
type Pinger struct {
// contains filtered or unexported fields
}
Pinger checks if it's time to send a ping. You can build a pinger for a specific use-case and re-use it when you want.
func (*Pinger) IsMaxReached ¶
IsMaxReached tells you if you've reached the limit yet
func (*Pinger) PingNotification ¶
func (p *Pinger) PingNotification(comments []*github.IssueComment, who string, startDate *time.Time) *Notification
PingNotification creates a new notification to ping `who`
func (*Pinger) SetDescription ¶
SetDescription is the description that goes along the ping
func (*Pinger) SetMaxCount ¶
SetMaxCount will make the pinger fail when it reaches maximum
type ReviewComment ¶
type ReviewComment github.PullRequestComment
func (*ReviewComment) AppendComment ¶
func (r *ReviewComment) AppendComment(comments []*github.IssueComment) []*github.IssueComment
func (*ReviewComment) AppendEvent ¶
func (r *ReviewComment) AppendEvent(events []*github.IssueEvent) []*github.IssueEvent
func (*ReviewComment) AppendReviewComment ¶
func (r *ReviewComment) AppendReviewComment(reviews []*github.PullRequestComment) []*github.PullRequestComment
func (*ReviewComment) Date ¶
func (r *ReviewComment) Date() *time.Time
func (*ReviewComment) Match ¶
func (r *ReviewComment) Match(matcher Matcher) bool
type UpdatedAfter ¶
UpdatedAfter matches comments updated after the time
func (UpdatedAfter) MatchComment ¶
func (u UpdatedAfter) MatchComment(comment *github.IssueComment) bool
MatchComment returns true if the comment is updated after the time
func (UpdatedAfter) MatchEvent ¶
func (u UpdatedAfter) MatchEvent(event *github.IssueEvent) bool
MatchEvent returns true if the event is updated after the time
func (UpdatedAfter) MatchReviewComment ¶
func (u UpdatedAfter) MatchReviewComment(review *github.PullRequestComment) bool
MatchReviewComment returns true if the review comment is updated after the time
type UpdatedBefore ¶
UpdatedBefore matches Items updated before the time
func (UpdatedBefore) MatchComment ¶
func (u UpdatedBefore) MatchComment(comment *github.IssueComment) bool
MatchComment returns true if the comment is created before the time
func (UpdatedBefore) MatchEvent ¶
func (u UpdatedBefore) MatchEvent(event *github.IssueEvent) bool
MatchEvent returns true if the event is created before the time
func (UpdatedBefore) MatchReviewComment ¶
func (u UpdatedBefore) MatchReviewComment(review *github.PullRequestComment) bool
MatchReviewComment returns true if the review comment is created before the time