sink

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 33 Imported by: 0

Documentation

Overview

Package sink. This file contains a hack functions to extract metadata from different source events to be used in PagerDuty payload.

Index

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, commGroupIdx int) 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, commGroupIdx int, c botkubeconfig.Elasticsearch, reporter AnalyticsReporter) (*Elasticsearch, error)

NewElasticsearch creates a new Elasticsearch instance.

func (*Elasticsearch) GetStatus

func (e *Elasticsearch) GetStatus() health.PlatformStatus

GetStatus gets sink status

func (*Elasticsearch) IntegrationName

IntegrationName describes the notifier integration name.

func (*Elasticsearch) SendEvent

func (e *Elasticsearch) SendEvent(ctx context.Context, rawData any, sources []string) error

SendEvent sends an event to a configured elasticsearch server.

func (*Elasticsearch) Type

Type describes the notifier type.

type EventLink struct {
	Href string `json:"href"`
	Text string `json:"text,omitempty"`
}

EventLink represents a link in a ChangeEvent and Alert event https://developer.pagerduty.com/docs/events-api-v2/send-change-events/#the-links-property

type PagerDuty

type PagerDuty struct {
	// contains filtered or unexported fields
}

PagerDuty provides functionality to notify PagerDuty service about new events.

func NewPagerDuty

func NewPagerDuty(log logrus.FieldLogger, commGroupIdx int, c config.PagerDuty, clusterName string, reporter AnalyticsReporter) (*PagerDuty, error)

NewPagerDuty creates a new PagerDuty instance.

func (*PagerDuty) GetStatus

func (w *PagerDuty) GetStatus() health.PlatformStatus

GetStatus gets sink status.

func (*PagerDuty) IntegrationName

func (w *PagerDuty) IntegrationName() config.CommPlatformIntegration

IntegrationName describes the notifier integration name.

func (*PagerDuty) SendEvent

func (w *PagerDuty) SendEvent(ctx context.Context, rawData any, sources []string) error

SendEvent sends an event to a configured server.

func (*PagerDuty) Type

func (w *PagerDuty) Type() config.IntegrationType

Type describes the notifier type.

type Sink

type Sink interface {
	notifier.Sink
}

Sink sends messages to communication channels. It is a one-way integration.

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, commGroupIdx int, c config.Webhook, reporter AnalyticsReporter) (*Webhook, error)

NewWebhook creates a new Webhook instance.

func (*Webhook) GetStatus

func (w *Webhook) GetStatus() health.PlatformStatus

GetStatus gets sink status

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, rawData any, sources []string) error

SendEvent sends an event to a configured server.

func (*Webhook) Type

func (w *Webhook) Type() config.IntegrationType

Type describes the notifier type.

type WebhookPayload

type WebhookPayload struct {
	Source    string    `json:"source,omitempty"`
	Data      any       `json:"data,omitempty"`
	TimeStamp time.Time `json:"timeStamp"`
}

WebhookPayload contains json payload to be sent to webhook url

Jump to

Keyboard shortcuts

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