webhook

package
v0.0.751 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics added in v0.0.525

type Metrics struct {
	WebhookCounter  *prometheus.CounterVec
	ResponseCounter *prometheus.CounterVec
}

Metrics is a set of metrics gathered by hook.

func NewMetrics added in v0.0.525

func NewMetrics() *Metrics

NewMetrics creates a new set of metrics for the hook server.

type Server added in v0.0.525

type Server struct {
	ClientAgent    *plugins.ClientAgent
	Plugins        *plugins.ConfigAgent
	ConfigAgent    *config.Agent
	ServerURL      *url.URL
	TokenGenerator func() []byte
	Metrics        *Metrics
	// contains filtered or unexported fields
}

Server keeps the information required to start a server

func (*Server) HandleBranchEvent added in v0.0.525

func (s *Server) HandleBranchEvent(entry *logrus.Entry, hook *scm.BranchHook)

HandleBranchEvent handles a branch event

func (*Server) HandleIssueCommentEvent added in v0.0.525

func (s *Server) HandleIssueCommentEvent(l *logrus.Entry, ic scm.IssueCommentHook)

HandleIssueCommentEvent handle comment events

func (*Server) HandlePullRequestCommentEvent added in v0.0.525

func (s *Server) HandlePullRequestCommentEvent(l *logrus.Entry, pc scm.PullRequestCommentHook)

HandlePullRequestCommentEvent handles pull request comments events

func (*Server) HandlePullRequestEvent added in v0.0.525

func (s *Server) HandlePullRequestEvent(l *logrus.Entry, pr *scm.PullRequestHook)

HandlePullRequestEvent handles a pull request event

func (*Server) HandlePushEvent added in v0.0.525

func (s *Server) HandlePushEvent(l *logrus.Entry, pe *scm.PushHook)

HandlePushEvent handles a push event

func (*Server) HandleReviewEvent added in v0.0.620

func (s *Server) HandleReviewEvent(l *logrus.Entry, re scm.ReviewHook)

HandleReviewEvent handles a PR review event

type WebhooksController added in v0.0.747

type WebhooksController struct {
	ConfigMapWatcher *watcher.ConfigMapWatcher
	// contains filtered or unexported fields
}

WebhooksController holds the command line arguments

func NewWebhooksController added in v0.0.747

func NewWebhooksController(path, namespace, botName, pluginFilename, configFilename string) (*WebhooksController, error)

NewWebhooksController creates and configures the controller

func (*WebhooksController) CleanupGitClientDir added in v0.0.747

func (o *WebhooksController) CleanupGitClientDir()

CleanupGitClientDir cleans up the git client's working directory

func (*WebhooksController) DefaultHandler added in v0.0.747

func (o *WebhooksController) DefaultHandler(w http.ResponseWriter, r *http.Request)

DefaultHandler responds to requests without a specific handler

func (*WebhooksController) HandleWebhookRequests added in v0.0.747

func (o *WebhooksController) HandleWebhookRequests(w http.ResponseWriter, r *http.Request)

HandleWebhookRequests handles incoming events

func (*WebhooksController) Health added in v0.0.747

Health returns either HTTP 204 if the service is healthy, otherwise nothing ('cos it's dead).

func (*WebhooksController) ProcessWebHook added in v0.0.747

func (o *WebhooksController) ProcessWebHook(l *logrus.Entry, webhook scm.Webhook) (*logrus.Entry, string, error)

ProcessWebHook process a webhook

func (*WebhooksController) Ready added in v0.0.747

Ready returns either HTTP 204 if the service is Ready to serve requests, otherwise HTTP 503.

Jump to

Keyboard shortcuts

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