Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewValidator ¶
func NewValidator() validator
NewValidator is a function that creates a validator struct with the passed in interface
Types ¶
type EventRequestPayload ¶
type EventRequestPayload struct { EventType string `json:"event-type"` EventTypeVersion string `json:"event-type-version"` EventID string `json:"event-id,omitempty"` //uuid should be generated automatically if send empty EventTime string `json:"event-time"` SourceID string `json:"source-id"` //put your application name here Data json.RawMessage `json:"data,omitempty"` //github webhook json payload }
EventRequestPayload represents a POST request's body which is sent to Event-Service
type HTTPClient ¶
HTTPClient is an interface use to allow mocking the http.Client methods
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
Sender is a struct used to allow mocking the SendToKyma function
func NewSender ¶
func NewSender(c HTTPClient, v Validator, serviceURL string) Sender
NewSender is a function that creates new Sender with the passed in interfaces
func (Sender) SendToKyma ¶
func (k Sender) SendToKyma(eventType, eventTypeVersion, eventID, sourceID string, data json.RawMessage) apperrors.AppError
SendToKyma is a function that sends the event given by the Github API to kyma's event bus
type Validator ¶
type Validator interface {
Validate(payload EventRequestPayload) apperrors.AppError
}
Validator is an interface used to allow mocking the validatePayload function
Click to show internal directories.
Click to hide internal directories.