Documentation ¶
Index ¶
- func LastComment(comments []*github.IssueComment, matcher Matcher, deflt *time.Time) *time.Time
- type And
- type Author
- type AuthorLogin
- type Command
- type CommandArguments
- type CommandName
- 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 []*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 True
- type ValidAuthor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LastComment ¶
LastComment returns the creation date of the last comment that matches. Or deflt if there is no such comment.
Types ¶
type AuthorLogin ¶
type AuthorLogin string
AuthorLogin matches comment made by this Author
func (AuthorLogin) Match ¶
func (a AuthorLogin) Match(comment *github.IssueComment) bool
Match if the Author is a match (ignoring case)
type Command ¶
Command is a way for human to interact with the bot
func ParseCommand ¶
func ParseCommand(comment *github.IssueComment) *Command
ParseCommand 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 *github.IssueComment) bool
Match if the command arguments match the regexp
type CommandName ¶
type CommandName string
CommandName identifies commands by name
func (CommandName) Match ¶
func (c CommandName) Match(comment *github.IssueComment) bool
Match will return true if the comment is a command with the given name
type CreatedAfter ¶
CreatedAfter matches comments created after the time
func (CreatedAfter) Match ¶
func (c CreatedAfter) Match(comment *github.IssueComment) 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 *github.IssueComment) bool
Match returns true if the comment is created before the time
type FilteredComments ¶
type FilteredComments []*github.IssueComment
FilteredComments is a list of comments
func FilterComments ¶
func FilterComments(comments []*github.IssueComment, 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() *github.IssueComment
GetLast returns the last comment in a series of comments
type Matcher ¶
type Matcher interface {
Match(comment *github.IssueComment) bool
}
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 *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) Match ¶
func (b NotificationName) Match(comment *github.IssueComment) 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 []*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 ValidAuthor ¶
type ValidAuthor struct{}
ValidAuthor validates that a comment has the author set
func (ValidAuthor) Match ¶
func (ValidAuthor) Match(comment *github.IssueComment) bool
Match if the comment has a valid author