Documentation ¶
Index ¶
- Constants
- type Loader
- type Message
- type StatusMessageContext
- type StatusMessageService
- func (s *StatusMessageService) HappyStatusMessage(description, statusFileSpec string, addIfMissing bool)
- func (s *StatusMessageService) SadStatusMessage(description, statusFileSpec string, addIfMissing bool)
- func (s *StatusMessageService) StatusMessage(commentMsgCreator func() string, addIfMissing bool) error
Constants ¶
const (
PluginTitleTemplate = "### Ike Plugins (%s)"
)
PluginTitleTemplate is a constant template containing "Ike Plugins (name-of-plugin)" title with markdown formatting
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Loader ¶
Loader keeps information necessary for status message loading
func (*Loader) LoadMessage ¶
func (l *Loader) LoadMessage(change scm.RepositoryChange, statusFileSpec string) string
LoadMessage loads a status message from the template files
type Message ¶
type Message struct { Thumbnail string Description string ConfigFile string Documentation string MessageFileURL string }
Message keeps all data used in message templates
type StatusMessageContext ¶
type StatusMessageContext struct {
// contains filtered or unexported fields
}
StatusMessageContext holds a plugin name and a assignee to be mentioned in the comment
func NewStatusMessageContext ¶
func NewStatusMessageContext(pluginName, documentationSection string, pr *gogh.PullRequest, c *config.PluginConfiguration) StatusMessageContext
NewStatusMessageContext creates an instance of StatusMessageContext with the given values
type StatusMessageService ¶
type StatusMessageService struct {
// contains filtered or unexported fields
}
StatusMessageService is a struct managing plugin comments
func NewStatusMessageService ¶
func NewStatusMessageService(client ghclient.Client, logger log.Logger, commentsLoader *ghservice.IssueCommentsLazyLoader, commentContext StatusMessageContext) *StatusMessageService
NewStatusMessageService creates an instance of GitHub StatusMessageService for the given StatusMessageContext
func (*StatusMessageService) HappyStatusMessage ¶
func (s *StatusMessageService) HappyStatusMessage(description, statusFileSpec string, addIfMissing bool)
HappyStatusMessage creates a message with the happy Ike image
func (*StatusMessageService) SadStatusMessage ¶
func (s *StatusMessageService) SadStatusMessage(description, statusFileSpec string, addIfMissing bool)
SadStatusMessage creates a message with the sad Ike image
func (*StatusMessageService) StatusMessage ¶
func (s *StatusMessageService) StatusMessage(commentMsgCreator func() string, addIfMissing bool) error
StatusMessage checks all present comments in the issue/pull-request. If no comment with PluginTitleTemplate (with the related plugin) is found, then it adds a new comment with the plugin title, assignee mention and the given commentMsg. If such a comment is present already, then it does nothing.