Documentation ¶
Index ¶
Constants ¶
const (
// BotName is the name of merge-bot
BotName = "k8s-merge-robot"
)
Variables ¶
This section is empty.
Functions ¶
func IsMungeBot ¶
IsMungeBot returns true only if given user is this bot.
func IsValidUser ¶
IsValidUser returns true only if given user has valid github username.
func PrettyMarshal ¶
func PrettyMarshal(data interface{}) []byte
PrettyMarshal creates pretty marshaled bytes from a structure.
func PrettyString ¶
func PrettyString(data interface{}) string
PrettyString is used by logging functions to get a readable version of a struct.
Types ¶
type FirstLabelTimeGetter ¶
FirstLabelTimeGetter represents anything that can get a label's first time. (interface is for testability / reduced import tree.)
type IssueUsers ¶
IssueUsers tracks Users involved in a github Issue
func GetIssueUsers ¶
func GetIssueUsers(issue *github.Issue) *IssueUsers
GetIssueUsers creates a new IssueUsers object from an issue's fields
func (*IssueUsers) AllUsers ¶
func (u *IssueUsers) AllUsers() UserSet
AllUsers return a list of unique users (both assignees and author)
type LabelTimeCache ¶
type LabelTimeCache struct {
// contains filtered or unexported fields
}
LabelTimeCache just caches the result of a time lookup, since the first time a label is applied never changes.
func NewLabelTimeCache ¶
func NewLabelTimeCache(label string) *LabelTimeCache
NewLabelTimeCache constructs a label time cache for the given label.
func (*LabelTimeCache) FirstLabelTime ¶
func (c *LabelTimeCache) FirstLabelTime(obj FirstLabelTimeGetter) (time.Time, bool)
FirstLabelTime returns a time from the cache if possible. Otherwise, it will look up the time. If that doesn't work either, it will return (time.Time{}, false).