plugins

package
v0.0.0-...-5666d16 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const AboutThisBot = "" /* 498-byte string literal not displayed */

Variables

This section is empty.

Functions

func FormatResponse

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

FormatResponse nicely formats a response to an issue comment.

func RegisterIssueCommentHandler

func RegisterIssueCommentHandler(name string, fn IssueCommentHandler)

func RegisterPullRequestHandler

func RegisterPullRequestHandler(name string, fn PullRequestHandler)

func RegisterPushEventHandler

func RegisterPushEventHandler(name string, fn PushEventHandler)

func RegisterStatusEventHandler

func RegisterStatusEventHandler(name string, fn StatusEventHandler)

Types

type IssueCommentHandler

type IssueCommentHandler func(PluginClient, github.IssueCommentEvent) 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) 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) 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
	JobAgent     *jobs.JobAgent
	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 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