plugins

package
v0.0.0-...-5952ad4 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const AboutThisBotCommands = "I understand the commands that are listed [here](https://github.com/kubernetes/test-infra/blob/master/commands.md)."
View Source
const AboutThisBotWithoutCommands = "" /* 369-byte string literal not displayed */

Variables

This section is empty.

Functions

func FormatICResponse

func FormatICResponse(ic github.IssueComment, s string) string

FormatICResponse nicely formats a response to an issue comment.

func FormatResponseRaw

func FormatResponseRaw(body, bodyURL, login, reply string) string

FormatResponseRaw nicely formats a response for one does not have an issue comment

func RegisterIssueCommentHandler

func RegisterIssueCommentHandler(name string, fn IssueCommentHandler)

func RegisterIssueHandler

func RegisterIssueHandler(name string, fn IssueHandler)

func RegisterPullRequestHandler

func RegisterPullRequestHandler(name string, fn PullRequestHandler)

func RegisterPushEventHandler

func RegisterPushEventHandler(name string, fn PushEventHandler)

func RegisterReviewCommentEventHandler

func RegisterReviewCommentEventHandler(name string, fn ReviewCommentEventHandler)

func RegisterReviewEventHandler

func RegisterReviewEventHandler(name string, fn ReviewEventHandler)

func RegisterStatusEventHandler

func RegisterStatusEventHandler(name string, fn StatusEventHandler)

Types

type IssueCommentHandler

type IssueCommentHandler func(PluginClient, github.IssueCommentEvent) error

type IssueHandler

type IssueHandler func(PluginClient, github.IssueEvent) error

type PluginAgent

type PluginAgent struct {
	PluginClient
	// contains filtered or unexported fields
}

func (*PluginAgent) IssueCommentHandlers

func (pa *PluginAgent) IssueCommentHandlers(owner, repo string) map[string]IssueCommentHandler

IssueCommentHandlers returns a map of plugin names to handlers for the repo.

func (*PluginAgent) IssueHandlers

func (pa *PluginAgent) IssueHandlers(owner, repo string) map[string]IssueHandler

IssueHandlers returns a map of plugin names to handlers for the repo.

func (*PluginAgent) Load

func (pa *PluginAgent) Load(path string) error

Load attempts to load config from the path. It returns an error if either the file can't be read or it contains an unknown plugin.

func (*PluginAgent) PullRequestHandlers

func (pa *PluginAgent) PullRequestHandlers(owner, repo string) map[string]PullRequestHandler

PullRequestHandlers returns a map of plugin names to handlers for the repo.

func (*PluginAgent) PushEventHandlers

func (pa *PluginAgent) PushEventHandlers(owner, repo string) map[string]PushEventHandler

PushEventHandlers returns a map of plugin names to handlers for the repo.

func (*PluginAgent) ReviewCommentEventHandlers

func (pa *PluginAgent) ReviewCommentEventHandlers(owner, repo string) map[string]ReviewCommentEventHandler

ReviewCommentEventHandlers returns a map of plugin names to handlers for the repo.

func (*PluginAgent) ReviewEventHandlers

func (pa *PluginAgent) ReviewEventHandlers(owner, repo string) map[string]ReviewEventHandler

ReviewEventHandlers returns a map of plugin names to handlers for the repo.

func (*PluginAgent) Start

func (pa *PluginAgent) Start(path string) error

Start starts polling path for plugin config. If the first attempt fails, then start returns the error. Future errors will halt updates but not stop.

func (*PluginAgent) StatusEventHandlers

func (pa *PluginAgent) StatusEventHandlers(owner, repo string) map[string]StatusEventHandler

StatusEventHandlers returns a map of plugin names to handlers for the repo.

type PluginClient

type PluginClient struct {
	GitHubClient *github.Client
	KubeClient   *kube.Client
	SlackClient  *slack.Client // This might be nil.
	Config       *config.Config
	Logger       *logrus.Entry
}

PluginClient may be used concurrently, so each entry must be thread-safe.

type PullRequestHandler

type PullRequestHandler func(PluginClient, github.PullRequestEvent) error

type PushEventHandler

type PushEventHandler func(PluginClient, github.PushEvent) error

type ReviewCommentEventHandler

type ReviewCommentEventHandler func(PluginClient, github.ReviewCommentEvent) error

type ReviewEventHandler

type ReviewEventHandler func(PluginClient, github.ReviewEvent) error

type StatusEventHandler

type StatusEventHandler func(PluginClient, github.StatusEvent) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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