message

package
v0.0.0-...-a196a74 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
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

type Loader struct {
	Message    *Message
	Log        log.Logger
	PluginName string
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL