Documentation ¶
Index ¶
- Constants
- func ExtractEventKind(event apimodels.KeptnContextExtendedCE) (string, *keptnv2.EventData, error)
- func GetStageFromShipyard(stageName string, shipyard *keptnv2.Shipyard) *keptnv2.Stage
- func GetTaskSequenceInStage(stageName, taskSequenceName string, shipyard *keptnv2.Shipyard) (*keptnv2.Sequence, error)
- func GetTestFinishedEventWithUnmatchedSource() apimodels.KeptnContextExtendedCE
- func GetTestStartedEvent() apimodels.KeptnContextExtendedCE
- func GetTestStartedEventWithUnmatchedTriggeredID() apimodels.KeptnContextExtendedCE
- func GetTestTriggeredEvent() apimodels.KeptnContextExtendedCE
- func ObjToJSON(obj interface{}) string
- func ShouldContainEvent(t *testing.T, events []apimodels.KeptnContextExtendedCE, eventType string, ...)
- func ShouldNotContainEvent(t *testing.T, events []apimodels.KeptnContextExtendedCE, eventType string, ...)
- type EventDispatcher
- func (e *EventDispatcher) Add(event models.DispatcherEvent, skipQueue bool) error
- func (e *EventDispatcher) OnSequenceAborted(eventScope models.EventScope)
- func (e *EventDispatcher) OnSequenceFinished(event apimodels.KeptnContextExtendedCE)
- func (e *EventDispatcher) OnSequenceTimeout(event apimodels.KeptnContextExtendedCE)
- func (e *EventDispatcher) Run(ctx context.Context)
- func (e *EventDispatcher) Stop()
- type EventScope
- type IEventDispatcher
- type ISequenceAbortedHook
- type ISequenceDispatcher
- type ISequenceFinishedHook
- type ISequencePausedHook
- type ISequenceResumedHook
- type ISequenceStartedHook
- type ISequenceTaskEventHook
- type ISequenceTimeoutHook
- type ISequenceTriggeredHook
- type ISequenceWaitingHook
- type IShipyardController
- type ISubSequenceFinishedHook
- type NextTaskSequence
- type SequenceDispatcher
- func (sd *SequenceDispatcher) Add(queueItem models.QueueItem) error
- func (sd *SequenceDispatcher) Remove(eventScope models.EventScope) error
- func (sd *SequenceDispatcher) Run(ctx context.Context, mode common.SDMode, ...)
- func (sd *SequenceDispatcher) SetStartSequenceCallback(startSequenceFunc func(event apimodels.KeptnContextExtendedCE) error)
- func (sd *SequenceDispatcher) Stop()
- type SequenceStateMaterializedView
- func (smv *SequenceStateMaterializedView) OnSequenceAborted(eventScope models.EventScope)
- func (smv *SequenceStateMaterializedView) OnSequenceFinished(event apimodels.KeptnContextExtendedCE)
- func (smv *SequenceStateMaterializedView) OnSequencePaused(pause models.EventScope)
- func (smv *SequenceStateMaterializedView) OnSequenceResumed(resume models.EventScope)
- func (smv *SequenceStateMaterializedView) OnSequenceStarted(event apimodels.KeptnContextExtendedCE)
- func (smv *SequenceStateMaterializedView) OnSequenceTaskEvent(event apimodels.KeptnContextExtendedCE)
- func (smv *SequenceStateMaterializedView) OnSequenceTimeout(event apimodels.KeptnContextExtendedCE)
- func (smv *SequenceStateMaterializedView) OnSequenceTriggered(event apimodels.KeptnContextExtendedCE)
- func (smv *SequenceStateMaterializedView) OnSequenceWaiting(event apimodels.KeptnContextExtendedCE)
- func (smv *SequenceStateMaterializedView) OnSubSequenceFinished(event apimodels.KeptnContextExtendedCE)
- func (smv *SequenceStateMaterializedView) UpdateLastEventOfSequence(event apimodels.KeptnContextExtendedCE) (apimodels.SequenceState, error)
- type SequenceWatcher
- type ShipyardController
- func (sc *ShipyardController) AddSequenceAbortedHook(hook ISequenceAbortedHook)
- func (sc *ShipyardController) AddSequenceFinishedHook(hook ISequenceFinishedHook)
- func (sc *ShipyardController) AddSequencePausedHook(hook ISequencePausedHook)
- func (sc *ShipyardController) AddSequenceResumedHook(hook ISequenceResumedHook)
- func (sc *ShipyardController) AddSequenceStartedHook(hook ISequenceStartedHook)
- func (sc *ShipyardController) AddSequenceTaskEventHook(hook ISequenceTaskEventHook)
- func (sc *ShipyardController) AddSequenceTimeoutHook(hook ISequenceTimeoutHook)
- func (sc *ShipyardController) AddSequenceTriggeredHook(hook ISequenceTriggeredHook)
- func (sc *ShipyardController) AddSequenceWaitingHook(hook ISequenceWaitingHook)
- func (sc *ShipyardController) AddSubSequenceFinishedHook(hook ISubSequenceFinishedHook)
- func (sc *ShipyardController) ControlSequence(controlSequence apimodels.SequenceControl) error
- func (sc *ShipyardController) GetAllTriggeredEvents(filter common.EventFilter) ([]apimodels.KeptnContextExtendedCE, error)
- func (sc *ShipyardController) GetTriggeredEventsOfProject(projectName string, filter common.EventFilter) ([]apimodels.KeptnContextExtendedCE, error)
- func (sc *ShipyardController) HandleIncomingEvent(event apimodels.KeptnContextExtendedCE, waitForCompletion bool) error
- func (sc ShipyardController) StartDispatchers(ctx context.Context, mode common.SDMode)
- func (sc *ShipyardController) StartTaskSequence(event apimodels.KeptnContextExtendedCE) error
- func (sc ShipyardController) StopDispatchers()
Constants ¶
const SequenceEvaluationService = "lighthouse-service"
const TestShipyardFile = `` /* 1033-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func ExtractEventKind ¶
func GetStageFromShipyard ¶
func GetTaskSequenceInStage ¶
func GetTestFinishedEventWithUnmatchedSource ¶
func GetTestFinishedEventWithUnmatchedSource() apimodels.KeptnContextExtendedCE
func GetTestStartedEvent ¶
func GetTestStartedEvent() apimodels.KeptnContextExtendedCE
func GetTestStartedEventWithUnmatchedTriggeredID ¶
func GetTestStartedEventWithUnmatchedTriggeredID() apimodels.KeptnContextExtendedCE
func GetTestTriggeredEvent ¶
func GetTestTriggeredEvent() apimodels.KeptnContextExtendedCE
func ShouldContainEvent ¶
func ShouldNotContainEvent ¶
Types ¶
type EventDispatcher ¶
type EventDispatcher struct {
// contains filtered or unexported fields
}
EventDispatcher is an implementation of IEventDispatcher It regularly fetches (queued) events from the database and eventually forwards them to the event broker
func NewEventDispatcher ¶
func NewEventDispatcher( eventRepo db.EventRepo, eventQueueRepo db.EventQueueRepo, sequenceExecutionRepo db.SequenceExecutionRepo, eventSender keptncommon.EventSender, syncInterval time.Duration, ) *EventDispatcher
NewEventDispatcher creates a new EventDispatcher
func (*EventDispatcher) Add ¶
func (e *EventDispatcher) Add(event models.DispatcherEvent, skipQueue bool) error
Add adds a DispatcherEvent to the event queue
func (*EventDispatcher) OnSequenceAborted ¶
func (e *EventDispatcher) OnSequenceAborted(eventScope models.EventScope)
func (*EventDispatcher) OnSequenceFinished ¶
func (e *EventDispatcher) OnSequenceFinished(event apimodels.KeptnContextExtendedCE)
func (*EventDispatcher) OnSequenceTimeout ¶
func (e *EventDispatcher) OnSequenceTimeout(event apimodels.KeptnContextExtendedCE)
func (*EventDispatcher) Run ¶
func (e *EventDispatcher) Run(ctx context.Context)
Run starts the event dispatcher loop which will periodically fetch (queued) events from the database and eventually forward/send them to the event broker The fetch interval is configured when creating a EventDispatcher using the "syncInterval" field
func (*EventDispatcher) Stop ¶
func (e *EventDispatcher) Stop()
type EventScope ¶
type IEventDispatcher ¶
type IEventDispatcher interface { Add(event models.DispatcherEvent, skipQueue bool) error Run(ctx context.Context) Stop() }
IEventDispatcher is responsible for dispatching events to be sent to the event broker
type ISequenceAbortedHook ¶
type ISequenceAbortedHook interface {
OnSequenceAborted(event models.EventScope)
}
type ISequenceDispatcher ¶
type ISequenceDispatcher interface { Add(queueItem models.QueueItem) error Run(ctx context.Context, mode common.SDMode, startSequenceFunc func(event apimodels.KeptnContextExtendedCE) error) Remove(eventScope models.EventScope) error Stop() }
ISequenceDispatcher is responsible for dispatching events to be sent to the event broker
func NewSequenceDispatcher ¶
func NewSequenceDispatcher( eventRepo db.EventRepo, sequenceQueueRepo db.SequenceQueueRepo, sequenceExecutionRepo db.SequenceExecutionRepo, syncInterval time.Duration, theClock clock.Clock, mode common.SDMode, ) ISequenceDispatcher
NewSequenceDispatcher creates a new SequenceDispatcher
type ISequenceFinishedHook ¶
type ISequenceFinishedHook interface {
OnSequenceFinished(event apimodels.KeptnContextExtendedCE)
}
type ISequencePausedHook ¶
type ISequencePausedHook interface {
OnSequencePaused(pause models.EventScope)
}
type ISequenceResumedHook ¶
type ISequenceResumedHook interface {
OnSequenceResumed(resume models.EventScope)
}
type ISequenceStartedHook ¶
type ISequenceStartedHook interface {
OnSequenceStarted(apimodels.KeptnContextExtendedCE)
}
type ISequenceTaskEventHook ¶
type ISequenceTaskEventHook interface {
OnSequenceTaskEvent(apimodels.KeptnContextExtendedCE)
}
type ISequenceTimeoutHook ¶
type ISequenceTimeoutHook interface {
OnSequenceTimeout(event apimodels.KeptnContextExtendedCE)
}
type ISequenceTriggeredHook ¶
type ISequenceTriggeredHook interface {
OnSequenceTriggered(apimodels.KeptnContextExtendedCE)
}
type ISequenceWaitingHook ¶
type ISequenceWaitingHook interface {
OnSequenceWaiting(apimodels.KeptnContextExtendedCE)
}
type IShipyardController ¶
type IShipyardController interface { GetAllTriggeredEvents(filter common.EventFilter) ([]apimodels.KeptnContextExtendedCE, error) GetTriggeredEventsOfProject(project string, filter common.EventFilter) ([]apimodels.KeptnContextExtendedCE, error) HandleIncomingEvent(event apimodels.KeptnContextExtendedCE, waitForCompletion bool) error ControlSequence(controlSequence apimodels.SequenceControl) error StartTaskSequence(event apimodels.KeptnContextExtendedCE) error StartDispatchers(ctx context.Context, mode common.SDMode) StopDispatchers() }
type ISubSequenceFinishedHook ¶
type ISubSequenceFinishedHook interface {
OnSubSequenceFinished(event apimodels.KeptnContextExtendedCE)
}
type NextTaskSequence ¶
func GetTaskSequencesByTrigger ¶
func GetTaskSequencesByTrigger(eventScope models.EventScope, completedTaskSequence string, shipyard *keptnv2.Shipyard, previousTask string) []NextTaskSequence
type SequenceDispatcher ¶
type SequenceDispatcher struct {
// contains filtered or unexported fields
}
func (*SequenceDispatcher) Add ¶
func (sd *SequenceDispatcher) Add(queueItem models.QueueItem) error
func (*SequenceDispatcher) Remove ¶
func (sd *SequenceDispatcher) Remove(eventScope models.EventScope) error
func (*SequenceDispatcher) Run ¶
func (sd *SequenceDispatcher) Run(ctx context.Context, mode common.SDMode, startSequenceFunc func(event apimodels.KeptnContextExtendedCE) error)
func (*SequenceDispatcher) SetStartSequenceCallback ¶
func (sd *SequenceDispatcher) SetStartSequenceCallback(startSequenceFunc func(event apimodels.KeptnContextExtendedCE) error)
func (*SequenceDispatcher) Stop ¶
func (sd *SequenceDispatcher) Stop()
type SequenceStateMaterializedView ¶
type SequenceStateMaterializedView struct { SequenceStateRepo db.SequenceStateRepo // contains filtered or unexported fields }
func NewSequenceStateMaterializedView ¶
func NewSequenceStateMaterializedView(stateRepo db.SequenceStateRepo) *SequenceStateMaterializedView
func (*SequenceStateMaterializedView) OnSequenceAborted ¶
func (smv *SequenceStateMaterializedView) OnSequenceAborted(eventScope models.EventScope)
func (*SequenceStateMaterializedView) OnSequenceFinished ¶
func (smv *SequenceStateMaterializedView) OnSequenceFinished(event apimodels.KeptnContextExtendedCE)
func (*SequenceStateMaterializedView) OnSequencePaused ¶
func (smv *SequenceStateMaterializedView) OnSequencePaused(pause models.EventScope)
func (*SequenceStateMaterializedView) OnSequenceResumed ¶
func (smv *SequenceStateMaterializedView) OnSequenceResumed(resume models.EventScope)
func (*SequenceStateMaterializedView) OnSequenceStarted ¶
func (smv *SequenceStateMaterializedView) OnSequenceStarted(event apimodels.KeptnContextExtendedCE)
func (*SequenceStateMaterializedView) OnSequenceTaskEvent ¶
func (smv *SequenceStateMaterializedView) OnSequenceTaskEvent(event apimodels.KeptnContextExtendedCE)
func (*SequenceStateMaterializedView) OnSequenceTimeout ¶
func (smv *SequenceStateMaterializedView) OnSequenceTimeout(event apimodels.KeptnContextExtendedCE)
func (*SequenceStateMaterializedView) OnSequenceTriggered ¶
func (smv *SequenceStateMaterializedView) OnSequenceTriggered(event apimodels.KeptnContextExtendedCE)
func (*SequenceStateMaterializedView) OnSequenceWaiting ¶
func (smv *SequenceStateMaterializedView) OnSequenceWaiting(event apimodels.KeptnContextExtendedCE)
func (*SequenceStateMaterializedView) OnSubSequenceFinished ¶
func (smv *SequenceStateMaterializedView) OnSubSequenceFinished(event apimodels.KeptnContextExtendedCE)
func (*SequenceStateMaterializedView) UpdateLastEventOfSequence ¶
func (smv *SequenceStateMaterializedView) UpdateLastEventOfSequence(event apimodels.KeptnContextExtendedCE) (apimodels.SequenceState, error)
type SequenceWatcher ¶
type SequenceWatcher struct {
// contains filtered or unexported fields
}
func NewSequenceWatcher ¶
func NewSequenceWatcher(cancelSequenceChannel chan apimodels.SequenceTimeout, eventRepo db.EventRepo, eventQueueRepo db.EventQueueRepo, projectRepo db.ProjectRepo, eventTimeout time.Duration, syncInterval time.Duration, theClock clock.Clock) *SequenceWatcher
func (*SequenceWatcher) Run ¶
func (sw *SequenceWatcher) Run(ctx context.Context)
type ShipyardController ¶
type ShipyardController struct {
// contains filtered or unexported fields
}
func GetShipyardControllerInstance ¶
func GetShipyardControllerInstance( ctx context.Context, eventDispatcher IEventDispatcher, sequenceDispatcher ISequenceDispatcher, sequenceTimeoutChannel chan apimodels.SequenceTimeout, shipyardRetriever shipyardretriever.IShipyardRetriever, ) *ShipyardController
func (*ShipyardController) AddSequenceAbortedHook ¶
func (sc *ShipyardController) AddSequenceAbortedHook(hook ISequenceAbortedHook)
func (*ShipyardController) AddSequenceFinishedHook ¶
func (sc *ShipyardController) AddSequenceFinishedHook(hook ISequenceFinishedHook)
func (*ShipyardController) AddSequencePausedHook ¶
func (sc *ShipyardController) AddSequencePausedHook(hook ISequencePausedHook)
func (*ShipyardController) AddSequenceResumedHook ¶
func (sc *ShipyardController) AddSequenceResumedHook(hook ISequenceResumedHook)
func (*ShipyardController) AddSequenceStartedHook ¶
func (sc *ShipyardController) AddSequenceStartedHook(hook ISequenceStartedHook)
func (*ShipyardController) AddSequenceTaskEventHook ¶
func (sc *ShipyardController) AddSequenceTaskEventHook(hook ISequenceTaskEventHook)
func (*ShipyardController) AddSequenceTimeoutHook ¶
func (sc *ShipyardController) AddSequenceTimeoutHook(hook ISequenceTimeoutHook)
func (*ShipyardController) AddSequenceTriggeredHook ¶
func (sc *ShipyardController) AddSequenceTriggeredHook(hook ISequenceTriggeredHook)
func (*ShipyardController) AddSequenceWaitingHook ¶
func (sc *ShipyardController) AddSequenceWaitingHook(hook ISequenceWaitingHook)
func (*ShipyardController) AddSubSequenceFinishedHook ¶
func (sc *ShipyardController) AddSubSequenceFinishedHook(hook ISubSequenceFinishedHook)
func (*ShipyardController) ControlSequence ¶
func (sc *ShipyardController) ControlSequence(controlSequence apimodels.SequenceControl) error
func (*ShipyardController) GetAllTriggeredEvents ¶
func (sc *ShipyardController) GetAllTriggeredEvents(filter common.EventFilter) ([]apimodels.KeptnContextExtendedCE, error)
func (*ShipyardController) GetTriggeredEventsOfProject ¶
func (sc *ShipyardController) GetTriggeredEventsOfProject(projectName string, filter common.EventFilter) ([]apimodels.KeptnContextExtendedCE, error)
func (*ShipyardController) HandleIncomingEvent ¶
func (sc *ShipyardController) HandleIncomingEvent(event apimodels.KeptnContextExtendedCE, waitForCompletion bool) error
func (ShipyardController) StartDispatchers ¶
func (sc ShipyardController) StartDispatchers(ctx context.Context, mode common.SDMode)
func (*ShipyardController) StartTaskSequence ¶
func (sc *ShipyardController) StartTaskSequence(event apimodels.KeptnContextExtendedCE) error
func (ShipyardController) StopDispatchers ¶
func (sc ShipyardController) StopDispatchers()