webhook

package
v0.0.2-gradle-executor Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Emitter

type Emitter struct {
	WebhooksClient *executorsclientv1.WebhooksClient
	Events         chan testkube.WebhookEvent
	Responses      chan WebhookResult
	Log            *zap.SugaredLogger
}

Emitter handles events emitting for webhooks

func NewEmitter

func NewEmitter(webhooksClient *executorsclientv1.WebhooksClient) *Emitter

NewEmitter returns new emitter instance

func (*Emitter) Listen

func (s *Emitter) Listen(events chan testkube.WebhookEvent)

Listen listens for webhook events

func (*Emitter) Notify

func (s *Emitter) Notify(event testkube.WebhookEvent)

Notify notifies emitter with webhook

func (Emitter) NotifyAll added in v1.3.1

func (s Emitter) NotifyAll(eventType *testkube.WebhookEventType, execution testkube.Execution) error

func (*Emitter) RunWorkers

func (s *Emitter) RunWorkers()

RunWorkers runs emitter workers responsible for sending HTTP requests

type WebhookHttpResponse

type WebhookHttpResponse struct {
	StatusCode int
	Body       string
}

WebhookHttpResponse hold body and result of webhook response

type WebhookResult

type WebhookResult struct {
	Event    testkube.WebhookEvent
	Error    error
	Response WebhookHttpResponse
}

WebhookResult is a wrapper for results from HTTP client for given webhook

Jump to

Keyboard shortcuts

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