Documentation ¶
Index ¶
- Variables
- func NewCache() *cache
- func ToIds(events []*models.KeptnContextExtendedCE) []string
- func WithGetRetryDelay(d time.Duration) func(eventAPI *HTTPEventAPI)
- func WithLog(logger logger.Logger) func(eventAPI *HTTPEventAPI)
- func WithLogger(logger logger.Logger) func(plane *HTTPEventSource)
- func WithMaxGetRetries(r uint) func(eventAPI *HTTPEventAPI)
- func WithMaxPollingAttempts(maxPollingAttempts int) func(plane *HTTPEventSource)
- func WithMaxSendRetries(r uint) func(eventAPI *HTTPEventAPI)
- func WithPollingInterval(interval time.Duration) func(plane *HTTPEventSource)
- func WithSendRetryDelay(d time.Duration) func(eventAPI *HTTPEventAPI)
- type EventAPI
- type GetEventAPI
- type HTTPEventAPI
- type HTTPEventSource
- func (hes *HTTPEventSource) Cleanup() error
- func (hes *HTTPEventSource) OnSubscriptionUpdate(subscriptions []models.EventSubscription)
- func (hes *HTTPEventSource) Sender() types.EventSender
- func (hes *HTTPEventSource) Start(ctx context.Context, data types.RegistrationData, ...) error
- func (hes *HTTPEventSource) Stop() error
- type SendEventAPI
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMaxPollRetriesExceeded = errors.New("maximum retries for polling event api exceeded")
Functions ¶
func ToIds ¶
func ToIds(events []*models.KeptnContextExtendedCE) []string
func WithGetRetryDelay ¶
func WithGetRetryDelay(d time.Duration) func(eventAPI *HTTPEventAPI)
func WithLog ¶
func WithLog(logger logger.Logger) func(eventAPI *HTTPEventAPI)
TODO: this should be called Withlogger
func WithLogger ¶
func WithLogger(logger logger.Logger) func(plane *HTTPEventSource)
WithLogger sets the logger to use
func WithMaxGetRetries ¶
func WithMaxGetRetries(r uint) func(eventAPI *HTTPEventAPI)
func WithMaxPollingAttempts ¶
func WithMaxPollingAttempts(maxPollingAttempts int) func(plane *HTTPEventSource)
WithMaxPollingAttempts sets the max number of attempts the HTTPEventSource shall retry to poll for new events when failing
func WithMaxSendRetries ¶
func WithMaxSendRetries(r uint) func(eventAPI *HTTPEventAPI)
func WithPollingInterval ¶
func WithPollingInterval(interval time.Duration) func(plane *HTTPEventSource)
WithPollingInterval sets the interval between doing consecutive HTTP calls to the Keptn API to get new events
func WithSendRetryDelay ¶
func WithSendRetryDelay(d time.Duration) func(eventAPI *HTTPEventAPI)
Types ¶
type EventAPI ¶
type EventAPI interface { Send(models.KeptnContextExtendedCE) error Get(api.EventFilter) ([]*models.KeptnContextExtendedCE, error) }
type GetEventAPI ¶
type GetEventAPI interface {
GetOpenTriggeredEvents(filter api.EventFilter) ([]*models.KeptnContextExtendedCE, error)
}
type HTTPEventAPI ¶
type HTTPEventAPI struct {
// contains filtered or unexported fields
}
func NewEventAPI ¶
func NewEventAPI(getAPI GetEventAPI, sendAPI SendEventAPI, options ...func(eventAPI *HTTPEventAPI)) *HTTPEventAPI
func (*HTTPEventAPI) Get ¶
func (ea *HTTPEventAPI) Get(filter api.EventFilter) (events []*models.KeptnContextExtendedCE, err error)
func (*HTTPEventAPI) Send ¶
func (ea *HTTPEventAPI) Send(e models.KeptnContextExtendedCE) error
type HTTPEventSource ¶
type HTTPEventSource struct {
// contains filtered or unexported fields
}
func New ¶
func New(clock clock.Clock, eventGetSender EventAPI, opts ...func(source *HTTPEventSource)) *HTTPEventSource
New creates a new HTTPEventSource to be used for running a service on the remote execution plane
func (*HTTPEventSource) Cleanup ¶
func (hes *HTTPEventSource) Cleanup() error
func (*HTTPEventSource) OnSubscriptionUpdate ¶
func (hes *HTTPEventSource) OnSubscriptionUpdate(subscriptions []models.EventSubscription)
func (*HTTPEventSource) Sender ¶
func (hes *HTTPEventSource) Sender() types.EventSender
func (*HTTPEventSource) Start ¶
func (hes *HTTPEventSource) Start(ctx context.Context, data types.RegistrationData, updates chan types.EventUpdate, errChan chan error, wg *sync.WaitGroup) error
func (*HTTPEventSource) Stop ¶
func (hes *HTTPEventSource) Stop() error
type SendEventAPI ¶
type SendEventAPI interface {
SendEvent(models.KeptnContextExtendedCE) (*models.EventContext, *models.Error)
}
Click to show internal directories.
Click to hide internal directories.