Documentation
¶
Overview ¶
Package metrics provides monitoring of the GitHub related metrics.
This depends on the metrics exporter of kubebuilder. See https://book.kubebuilder.io/reference/metrics.html for details.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventReader ¶
type EventReader struct { Log logr.Logger // GitHub Client to fetch information about job failures GitHubClient *github.Client // Event queue Events chan interface{} }
func (*EventReader) HandleWorkflowJobEvent ¶
func (reader *EventReader) HandleWorkflowJobEvent(event interface{})
HandleWorkflowJobEvent send event to reader channel for processing
forcing the events through a channel ensures they are processed in sequentially, and prevents any race conditions with githubWorkflowJobStatus
func (*EventReader) ProcessWorkflowJobEvent ¶
func (reader *EventReader) ProcessWorkflowJobEvent(ctx context.Context, event interface{})
ProcessWorkflowJobEvent processes a single event
Events should be processed in the same order that Github emits them
func (*EventReader) ProcessWorkflowJobEvents ¶
func (reader *EventReader) ProcessWorkflowJobEvents(ctx context.Context)
ProcessWorkflowJobEvents pop events in a loop for processing
Should be called asynchronously with `go`
type ParseResult ¶
type WebhookServer ¶
type WebhookServer struct { Log logr.Logger // SecretKeyBytes is the byte representation of the Webhook secret token // the administrator is generated and specified in GitHub Web UI. SecretKeyBytes []byte // GitHub Client to discover runner groups assigned to a repository GitHubClient *github.Client // When HorizontalRunnerAutoscalerGitHubWebhook handles a request, each EventHook is sent the webhook event EventHooks []EventHook }
WebhookServer is a HTTP server that handles workflow_job events sent from GitHub Actions
func (*WebhookServer) Handle ¶
func (autoscaler *WebhookServer) Handle(w http.ResponseWriter, r *http.Request)