Documentation
¶
Index ¶
- func LastComment(comments []*Comment, matcher Matcher, deflt *time.Time) *time.Time
- type And
- type Author
- type AuthorLogin
- type Command
- type CommandArguments
- type CommandName
- type Comment
- func FromIssueComment(ic *github.IssueComment) *Comment
- func FromIssueComments(ics []*github.IssueComment) []*Comment
- func FromReview(review *github.PullRequestReview) *Comment
- func FromReviewComment(rc *github.PullRequestComment) *Comment
- func FromReviewComments(rcs []*github.PullRequestComment) []*Comment
- func FromReviews(reviews []*github.PullRequestReview) []*Comment
- type CreatedAfter
- type CreatedBefore
- type False
- type FilteredComments
- type Matcher
- type Not
- type Notification
- type NotificationName
- type Or
- type Pinger
- func (p *Pinger) IsMaxReached(comments []*Comment, startDate *time.Time) bool
- func (p *Pinger) PingNotification(comments []*Comment, 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 True
- type ValidAuthor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthorLogin ¶
type AuthorLogin string
AuthorLogin matches comment made by this Author
func (AuthorLogin) Match ¶
func (a AuthorLogin) Match(comment *Comment) bool
Match if the Author is a match (ignoring case)
type Command ¶
Command is a way for human to interact with the bot
func ParseCommands ¶
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) Match ¶
func (c *CommandArguments) Match(comment *Comment) bool
Match if the comment contains a command whose arguments match the regexp
type CommandName ¶
type CommandName string
CommandName identifies commands by name
func (CommandName) Match ¶
func (c CommandName) Match(comment *Comment) bool
Match if the comment contains a command with the given name
type Comment ¶
type Comment struct { Body *string Author *string CreatedAt *time.Time UpdatedAt *time.Time HTMLURL *string Source interface{} }
Comment is a struct that represents a generic text post on github.
func FromIssueComment ¶
func FromIssueComment(ic *github.IssueComment) *Comment
func FromIssueComments ¶
func FromIssueComments(ics []*github.IssueComment) []*Comment
func FromReview ¶
func FromReview(review *github.PullRequestReview) *Comment
func FromReviewComment ¶
func FromReviewComment(rc *github.PullRequestComment) *Comment
func FromReviewComments ¶
func FromReviewComments(rcs []*github.PullRequestComment) []*Comment
func FromReviews ¶
func FromReviews(reviews []*github.PullRequestReview) []*Comment
type CreatedAfter ¶
CreatedAfter matches comments created after the time
func (CreatedAfter) Match ¶
func (c CreatedAfter) Match(comment *Comment) bool
Match returns true if the comment is created after the time
type CreatedBefore ¶
CreatedBefore matches comments created before the time
func (CreatedBefore) Match ¶
func (c CreatedBefore) Match(comment *Comment) bool
Match returns true if the comment is created before the time
type FilteredComments ¶
type FilteredComments []*Comment
FilteredComments is a list of comments
func FilterComments ¶
func FilterComments(comments []*Comment, matcher Matcher) FilteredComments
FilterComments will return the list of matching comments
func (FilteredComments) Empty ¶
func (f FilteredComments) Empty() bool
Empty Checks to see if the list of comments is empty
func (FilteredComments) GetLast ¶
func (f FilteredComments) GetLast() *Comment
GetLast returns the last comment in a series of comments
type Matcher ¶
Matcher is an interface to match a comment
func HumanActor ¶
func HumanActor() Matcher
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 MungeBotAuthor ¶
func MungeBotAuthor() Matcher
MungeBotAuthor creates a matcher to find mungebot comments
func MungerNotificationName ¶
MungerNotificationName finds notification posted by the munger, based on name
type Notification ¶
Notification is a message sent by the bot. Easy to find and create.
func ParseNotification ¶
func ParseNotification(comment *Comment) *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) Match ¶
func (b NotificationName) Match(comment *Comment) bool
Match returns true if the comment is a notification with the given name
type Or ¶
type Or []Matcher
Or makes sure that at least one element in the list matches (false if empty)
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 []*Comment, 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 ValidAuthor ¶
type ValidAuthor struct{}
ValidAuthor validates that a comment has the author set
func (ValidAuthor) Match ¶
func (ValidAuthor) Match(comment *Comment) bool
Match if the comment has a valid author