Documentation
¶
Index ¶
- type AnalyticsReporter
- type Elasticsearch
- func (e *Elasticsearch) IntegrationName() config.CommPlatformIntegration
- func (e *Elasticsearch) SendEvent(ctx context.Context, event event.Event, eventSources []string) (err error)
- func (e *Elasticsearch) SendGenericMessage(_ context.Context, _ interactive.GenericMessage, _ []string) error
- func (e *Elasticsearch) SendMessageToAll(_ context.Context, _ interactive.Message) error
- func (e *Elasticsearch) Type() config.IntegrationType
- type EventMeta
- type EventStatus
- type Sink
- type Webhook
- func (w *Webhook) IntegrationName() config.CommPlatformIntegration
- func (w *Webhook) PostWebhook(ctx context.Context, jsonPayload *WebhookPayload) (err error)
- func (w *Webhook) SendEvent(ctx context.Context, event event.Event, eventSources []string) (err error)
- func (w *Webhook) SendGenericMessage(_ context.Context, _ interactive.GenericMessage, _ []string) error
- func (w *Webhook) SendMessageToAll(_ context.Context, _ interactive.Message) error
- func (w *Webhook) Type() config.IntegrationType
- type WebhookPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalyticsReporter ¶
type AnalyticsReporter interface { // ReportSinkEnabled reports an enabled sink. ReportSinkEnabled(platform config.CommPlatformIntegration) error }
AnalyticsReporter defines a reporter that collects analytics data for sinks.
type Elasticsearch ¶
type Elasticsearch struct {
// contains filtered or unexported fields
}
Elasticsearch provides integration with the Elasticsearch solution.
func NewElasticsearch ¶
func NewElasticsearch(log logrus.FieldLogger, c config.Elasticsearch, reporter AnalyticsReporter) (*Elasticsearch, error)
NewElasticsearch creates a new Elasticsearch instance.
func (*Elasticsearch) IntegrationName ¶
func (e *Elasticsearch) IntegrationName() config.CommPlatformIntegration
IntegrationName describes the notifier integration name.
func (*Elasticsearch) SendEvent ¶
func (e *Elasticsearch) SendEvent(ctx context.Context, event event.Event, eventSources []string) (err error)
SendEvent sends event notification to Elasticsearch
func (*Elasticsearch) SendGenericMessage ¶ added in v0.16.0
func (e *Elasticsearch) SendGenericMessage(_ context.Context, _ interactive.GenericMessage, _ []string) error
SendGenericMessage is no-op.
func (*Elasticsearch) SendMessageToAll ¶ added in v0.16.0
func (e *Elasticsearch) SendMessageToAll(_ context.Context, _ interactive.Message) error
SendMessageToAll is no-op.
func (*Elasticsearch) Type ¶
func (e *Elasticsearch) Type() config.IntegrationType
Type describes the notifier type.
type EventMeta ¶
type EventMeta struct { Kind string `json:"kind"` Name string `json:"name"` Namespace string `json:"namespace"` Cluster string `json:"cluster,omitempty"` }
EventMeta contains the metadata about the event occurred
type EventStatus ¶
type EventStatus struct { Type config.EventType `json:"type"` Level config.Level `json:"level"` Reason string `json:"reason,omitempty"` Error string `json:"error,omitempty"` Messages []string `json:"messages,omitempty"` }
EventStatus contains the status about the event occurred
type Webhook ¶
type Webhook struct { URL string Bindings config.SinkBindings // contains filtered or unexported fields }
Webhook provides functionality to notify external service about new events.
func NewWebhook ¶
func NewWebhook(log logrus.FieldLogger, c config.Webhook, reporter AnalyticsReporter) (*Webhook, error)
NewWebhook creates a new Webhook instance.
func (*Webhook) IntegrationName ¶
func (w *Webhook) IntegrationName() config.CommPlatformIntegration
IntegrationName describes the notifier integration name.
func (*Webhook) PostWebhook ¶
func (w *Webhook) PostWebhook(ctx context.Context, jsonPayload *WebhookPayload) (err error)
PostWebhook posts webhook to listener
func (*Webhook) SendEvent ¶
func (w *Webhook) SendEvent(ctx context.Context, event event.Event, eventSources []string) (err error)
SendEvent sends event notification to Webhook url
func (*Webhook) SendGenericMessage ¶ added in v0.16.0
func (w *Webhook) SendGenericMessage(_ context.Context, _ interactive.GenericMessage, _ []string) error
SendGenericMessage is no-op.
func (*Webhook) SendMessageToAll ¶ added in v0.16.0
SendMessageToAll is no-op.
func (*Webhook) Type ¶
func (w *Webhook) Type() config.IntegrationType
Type describes the notifier type.
type WebhookPayload ¶
type WebhookPayload struct { EventMeta EventMeta `json:"meta"` EventStatus EventStatus `json:"status"` EventSummary string `json:"summary"` TimeStamp time.Time `json:"timestamp"` Recommendations []string `json:"recommendations,omitempty"` Warnings []string `json:"warnings,omitempty"` }
WebhookPayload contains json payload to be sent to webhook url