event

package
v1.5.10 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 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.Event
	Results   chan testkube.EventResult
	Listeners common.Listeners
	Loader    Loader
	Log       *zap.SugaredLogger
	// contains filtered or unexported fields
}

Emitter handles events emitting for webhooks

func NewEmitter

func NewEmitter() *Emitter

NewEmitter returns new emitter instance

func (*Emitter) Notify

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

Notify notifies emitter with webhook

func (*Emitter) OverrideListeners

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

Notify notifies emitter with webhook

func (*Emitter) Reconcile

func (s *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) RunWorker

func (e *Emitter) RunWorker(events chan testkube.Event, results chan testkube.EventResult)

RunWorker runs single emitter worker loop responsible for sending events

func (*Emitter) RunWorkers

func (e *Emitter) RunWorkers()

RunWorkers runs emitter workers responsible for sending HTTP requests

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(reconciler 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