event_handler

package
v0.0.0-...-3da42c7 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynatraceEventHandler

type DynatraceEventHandler interface {
	// HandleEvent handles an event.
	// Two contexts are provided: workCtx should be used to do work, replyCtx should be used to reply to Keptn (even if workCtx is done).
	HandleEvent(workCtx context.Context, replyCtx context.Context) error
}

DynatraceEventHandler is the common interface for all event handlers.

func NewEventHandler

func NewEventHandler(ctx context.Context, clientFactory keptn.ClientFactoryInterface, eventSenderClient keptn.EventSenderClientInterface, event cloudevents.Event) (DynatraceEventHandler, error)

NewEventHandler creates a new DynatraceEventHandler for the specified event.

type ErrorData

type ErrorData struct {
	Message       string `json:"message"`
	IntegrationID string `json:"integrationid"`
	Task          string `json:"task,omitempty"`
}

type ErrorEventFactory

type ErrorEventFactory struct {
	// contains filtered or unexported fields
}

func NewErrorEventFactory

func NewErrorEventFactory(event cloudevents.Event, err error, integrationID string) *ErrorEventFactory

func (*ErrorEventFactory) CreateCloudEvent

func (f *ErrorEventFactory) CreateCloudEvent() (*cloudevents.Event, error)

type ErrorHandler

type ErrorHandler struct {
	// contains filtered or unexported fields
}

ErrorHandler handles errors by trying to send them to Keptn Uniform.

func NewErrorHandler

func NewErrorHandler(err error, event cloudevents.Event, eventSenderClient keptn.EventSenderClientInterface, uniformClient keptn.UniformClientInterface) *ErrorHandler

NewErrorHandler creates a new ErrorHandler for the specified error, event, ClientInterface and UniformClientInterface.

func (ErrorHandler) HandleEvent

func (eh ErrorHandler) HandleEvent(workCtx context.Context, replyCtx context.Context) error

HandleEvent handles errors by sending an error event.

type NoOpHandler

type NoOpHandler struct {
}

func (NoOpHandler) HandleEvent

func (eh NoOpHandler) HandleEvent(workCtx context.Context, replyCtx context.Context) error

HandleEvent handles an event by doing nothing.

Jump to

Keyboard shortcuts

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