Documentation ¶
Index ¶
- func HandledEventsCounterWithLabelValues(lvs ...string) (prometheus.Counter, error)
- func RateLimitWithLabelValues(lvs ...string) (prometheus.Gauge, error)
- func RegisterMetrics(client ghclient.Client) []error
- func RegisterOrAssignCollector(collector prometheus.Collector, errors *[]error, ...)
- func UnRegisterAndResetMetrics()
- func WebHookCounterWithLabelValues(lvs ...string) (prometheus.Counter, error)
- type GitHubEventHandler
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandledEventsCounterWithLabelValues ¶
func HandledEventsCounterWithLabelValues(lvs ...string) (prometheus.Counter, error)
HandledEventsCounterWithLabelValues replaces the method of the same name in MetricVec.
func RateLimitWithLabelValues ¶
func RateLimitWithLabelValues(lvs ...string) (prometheus.Gauge, error)
RateLimitWithLabelValues replaces the method of the same name in MetricVec.
func RegisterMetrics ¶
RegisterMetrics registers prometheus collectors to collect metrics
func RegisterOrAssignCollector ¶
func RegisterOrAssignCollector(collector prometheus.Collector, errors *[]error, assign func(regCollector prometheus.Collector))
RegisterOrAssignCollector registers the provided Collector with the DefaultRegisterer and assigns the Collector, unless an equal Collector was registered before, in which case that Collector is assigned.
func UnRegisterAndResetMetrics ¶
func UnRegisterAndResetMetrics()
UnRegisterAndResetMetrics unregisters and reset prometheus collectors.
func WebHookCounterWithLabelValues ¶
func WebHookCounterWithLabelValues(lvs ...string) (prometheus.Counter, error)
WebHookCounterWithLabelValues replaces the method of the same name in MetricVec.
Types ¶
type GitHubEventHandler ¶
type GitHubEventHandler interface { HandlePullRequestEvent(logger log.Logger, event *gogh.PullRequestEvent) error HandleIssueCommentEvent(logger log.Logger, event *gogh.IssueCommentEvent) error }
GitHubEventHandler is a type which keeps the logic of handling GitHub events for the given plugin implementation. It is used by Server implementation to handle incoming events.
type Server ¶
type Server struct { GitHubEventHandler GitHubEventHandler HmacSecret []byte PluginName string }
Server implements http.Handler. It validates incoming GitHub webhooks and then dispatches them to the appropriate plugins.