controlplane

package
v0.20.4 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 16 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEventHandleFatal = errors.New("fatal event handling error")

Functions

func RunWithGracefulShutdown

func RunWithGracefulShutdown(controlPlane *ControlPlane, integration Integration, shutdownTimeout time.Duration) error

RunWithGracefulShutdown starts the controlplane component which takes care of registering the integration and handling events and subscriptions. Further, it supports graceful shutdown handling when receiving a SIGHUB, SIGINT, SIGQUIT, SIGARBT or SIGTERM signal.

This call is blocking.

If you want to start the controlPlane component with an own context you need to call the Register(ctx,integration) method on your own

func WithLogger

func WithLogger(logger logger.Logger) func(plane *ControlPlane)

WithLogger sets the logger to use

Types

type ControlPlane

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

ControlPlane can be used to connect to the Keptn Control Plane

func New

func New(subscriptionSource subscriptionsource.SubscriptionSource, eventSource eventsource.EventSource, logForwarder logforwarder.LogForwarder, opts ...func(plane *ControlPlane)) *ControlPlane

New creates a new ControlPlane It is using a SubscriptionSource source to get information about current uniform subscriptions as well as an EventSource to actually receive events from Keptn and a LogForwarder to forward error logs

func (*ControlPlane) IsRegistered

func (cp *ControlPlane) IsRegistered() bool

IsRegistered can be called to detect whether the controlPlane is registered and ready to receive events

func (*ControlPlane) Register

func (cp *ControlPlane) Register(ctx context.Context, integration Integration) error

Register is initially used to register the Keptn integration to the Control Plane

type EventSender

type EventSender = types.EventSender

type EventSenderKeyType

type EventSenderKeyType = types.EventSenderKeyType

type Integration

type Integration interface {
	// OnEvent is called when a new event was received
	OnEvent(context.Context, models.KeptnContextExtendedCE) error

	// RegistrationData is called to get the initial registration data
	RegistrationData() types.RegistrationData
}

Integration represents a Keptn Service that wants to receive events from the Keptn Control plane

type RegistrationData

type RegistrationData = types.RegistrationData

Jump to

Keyboard shortcuts

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