http

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMaxPollRetriesExceeded = errors.New("maximum retries for polling event api exceeded")

Functions

func NewCache

func NewCache() *cache

NewCache creates a new cache

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

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)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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