webhook

package
v1.0.8-beta004 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: MIT Imports: 7 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 {
	Events    chan testkube.WebhookEvent
	Responses chan WebhookResult
	Log       *zap.SugaredLogger
}

Emitter handles events emitting for webhooks

func NewEmitter

func NewEmitter() *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) RunWorkers

func (s *Emitter) RunWorkers()

RunWorkers runs emitter workers responsible for sending HTTP requests

func (*Emitter) Send

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

Send sends new webhook event - should be used when some event occurs

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