Documentation
¶
Index ¶
- Constants
- func NewCmdWebhook() *cobra.Command
- type Metrics
- type Options
- type Server
- func (s *Server) HandleBranchEvent(entry *logrus.Entry, hook *scm.BranchHook)
- func (s *Server) HandleIssueCommentEvent(l *logrus.Entry, ic scm.IssueCommentHook)
- func (s *Server) HandlePullRequestCommentEvent(l *logrus.Entry, pc scm.PullRequestCommentHook)
- func (s *Server) HandlePullRequestEvent(l *logrus.Entry, pr *scm.PullRequestHook)
- func (s *Server) HandlePushEvent(l *logrus.Entry, pe *scm.PushHook)
- func (s *Server) HandleReviewEvent(l *logrus.Entry, re scm.ReviewHook)
Constants ¶
View Source
const ( // HealthPath is the URL path for the HTTP endpoint that returns health status. HealthPath = "/health" // ReadyPath URL path for the HTTP endpoint that returns ready status. ReadyPath = "/ready" )
Variables ¶
This section is empty.
Functions ¶
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 Options ¶
type Options struct {
BindAddress string
Path string
Port int
JSONLog bool
// contains filtered or unexported fields
}
Options holds the command line arguments
func NewWebhook ¶
NewWebhook creates a new webhook handler
func (*Options) GetFactory ¶
GetFactory lazily creates a Factory if its not already created
type Server ¶ added in v0.0.525
type Server struct {
ClientFactory jxfactory.Factory
MetapipelineClient metapipeline.Client
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
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
Click to show internal directories.
Click to hide internal directories.