event

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: MIT Imports: 8 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 {
	Results   chan testkube.EventResult
	Listeners common.Listeners
	Loader    *Loader
	Log       *zap.SugaredLogger

	Bus bus.Bus
	// contains filtered or unexported fields
}

Emitter handles events emitting for webhooks

func NewEmitter

func NewEmitter(eventBus bus.Bus) *Emitter

NewEmitter returns new emitter instance

func (*Emitter) Listen added in v1.5.17

func (e *Emitter) Listen(ctx context.Context)

Listen runs emitter workers responsible for sending HTTP requests

func (*Emitter) Notify

func (e *Emitter) Notify(event testkube.Event)

Notify notifies emitter with webhook

func (*Emitter) Reconcile

func (e *Emitter) Reconcile(ctx context.Context)

Reconcile reloads listeners from all registered reconcilers

func (*Emitter) Register

func (e *Emitter) Register(listener common.Listener)

Register adds new listener

func (*Emitter) UpdateListeners added in v1.5.17

func (e *Emitter) UpdateListeners(listeners common.Listeners)

UpdateListeners updates listeners list

type Loader

type Loader struct {
	Log     *zap.SugaredLogger
	Loaders []common.ListenerLoader
}

Loader updates list of available listeners in the background as we don't want to load them on each event

func NewLoader

func NewLoader() *Loader

func (*Loader) Reconcile

func (s *Loader) Reconcile() (listeners common.Listeners)

Reconcile loop for reconciling listeners from different sources

func (*Loader) Register

func (s *Loader) Register(loader common.ListenerLoader)

Register registers new listener reconciler

Directories

Path Synopsis
kind

Jump to

Keyboard shortcuts

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