Documentation ¶
Index ¶
- Constants
- func FormatResponse(ic gitlabhook.MergeRequestCommentEvent, s string) string
- func RegisterGroupHandler(name string, fn GroupHandler)
- func RegisterMergeCommentEventHandler(name string, fn MergeCommentEventHandler)
- type GroupHandler
- type MergeCommentEventHandler
- type PluginAgent
- type PluginClient
- type Repo
Constants ¶
const AboutThisBot = "Instructions for interacting with me using Merge Requests comments are available at https://github.com/cosminilie/gitbot"
Variables ¶
This section is empty.
Functions ¶
func FormatResponse ¶
func FormatResponse(ic gitlabhook.MergeRequestCommentEvent, s string) string
FormatResponse nicely formats a response to an issue comment.
func RegisterGroupHandler ¶
func RegisterGroupHandler(name string, fn GroupHandler)
func RegisterMergeCommentEventHandler ¶
func RegisterMergeCommentEventHandler(name string, fn MergeCommentEventHandler)
RegisterMergeCommentEventHandler registers MergeCommentEventHandler in the global handler register
Types ¶
type GroupHandler ¶
type GroupHandler func(*PluginClient, string) error
type MergeCommentEventHandler ¶
type MergeCommentEventHandler func(*PluginClient, gitlabhook.MergeRequestCommentEvent) error
MergeCommentEventHandler func that handle merge request comments
type PluginAgent ¶
type PluginAgent struct { PluginClient Repos map[string]Repo GroupRepos map[string]Repo // contains filtered or unexported fields }
PluginAgent is the main struct which store the information needed to associated plugins with repo and pass PluginClients to each registered handler
func NewPluginAgent ¶
NewPluginAgent creates a new plugin agent
func (*PluginAgent) GroupHandlers ¶
func (pa *PluginAgent) GroupHandlers(repo string) map[string]GroupHandler
GlobalHandlers returns a map of plugin names to apply for all repos without waiting for events.
func (*PluginAgent) MergeCommentEventHandlers ¶
func (pa *PluginAgent) MergeCommentEventHandlers(repo string) map[string]MergeCommentEventHandler
StatusEventHandlers returns a map of plugin names to merge request comments handler for the repo.
type PluginClient ¶
PluginClient may be used concurrently, so each entry must be thread-safe.