Documentation
¶
Index ¶
- Constants
- type AnalyticsReporter
- type Bot
- type Discord
- func (b *Discord) BotName() string
- func (b *Discord) IntegrationName() config.CommPlatformIntegration
- func (b *Discord) NotificationsEnabled(channelID string) bool
- func (b *Discord) SendEvent(_ context.Context, event event.Event, eventSources []string) (err error)
- func (b *Discord) SendGenericMessage(_ context.Context, genericMsg interactive.GenericMessage, ...) error
- func (b *Discord) SendMessageToAll(_ context.Context, msg interactive.Message) error
- func (b *Discord) SetNotificationsEnabled(channelID string, enabled bool) error
- func (b *Discord) Start(ctx context.Context) error
- func (b *Discord) Type() config.IntegrationType
- type EventCommandProvider
- type ExecutorFactory
- type FatalErrorAnalyticsReporter
- type Mattermost
- func (b *Mattermost) BotName() string
- func (b *Mattermost) IntegrationName() config.CommPlatformIntegration
- func (b *Mattermost) NotificationsEnabled(channelID string) bool
- func (b *Mattermost) SendEvent(_ context.Context, event event.Event, eventSources []string) error
- func (b *Mattermost) SendGenericMessage(_ context.Context, genericMsg interactive.GenericMessage, ...) error
- func (b *Mattermost) SendMessageToAll(_ context.Context, msg interactive.Message) error
- func (b *Mattermost) SetNotificationsEnabled(channelID string, enabled bool) error
- func (b *Mattermost) Start(ctx context.Context) error
- func (b *Mattermost) Type() config.IntegrationType
- type Slack
- func (b *Slack) BotName() string
- func (b *Slack) IntegrationName() config.CommPlatformIntegration
- func (b *Slack) NotificationsEnabled(channelName string) bool
- func (b *Slack) SendEvent(ctx context.Context, event event.Event, eventSources []string) error
- func (b *Slack) SendGenericMessage(_ context.Context, genericMsg interactive.GenericMessage, ...) error
- func (b *Slack) SendMessageToAll(ctx context.Context, msg interactive.Message) error
- func (b *Slack) SetNotificationsEnabled(channelName string, enabled bool) error
- func (b *Slack) Start(ctx context.Context) error
- func (b *Slack) Type() config.IntegrationType
- type SlackRenderer
- func (b *SlackRenderer) RenderAsSlackBlocks(msg interactive.Message) []slack.Block
- func (b *SlackRenderer) RenderEventMessage(event event.Event, additionalSections ...interactive.Section) interactive.Message
- func (b *SlackRenderer) RenderInteractiveMessage(msg interactive.Message) slack.MsgOption
- func (b *SlackRenderer) RenderLegacyEventMessage(event event.Event) slack.Attachment
- func (b *SlackRenderer) RenderModal(msg interactive.Message) slack.ModalViewRequest
- type SocketSlack
- func (b *SocketSlack) BotName() string
- func (b *SocketSlack) IntegrationName() config.CommPlatformIntegration
- func (b *SocketSlack) NotificationsEnabled(channelName string) bool
- func (b *SocketSlack) SendEvent(ctx context.Context, event event.Event, eventSources []string) error
- func (b *SocketSlack) SendGenericMessage(_ context.Context, genericMsg interactive.GenericMessage, ...) error
- func (b *SocketSlack) SendMessageToAll(ctx context.Context, msg interactive.Message) error
- func (b *SocketSlack) SetNotificationsEnabled(channelName string, enabled bool) error
- func (b *SocketSlack) Start(ctx context.Context) error
- func (b *SocketSlack) Type() config.IntegrationType
- type Teams
- func (b *Teams) BotName() string
- func (b *Teams) IntegrationName() config.CommPlatformIntegration
- func (b *Teams) NotificationsEnabled(channelID string) bool
- func (b *Teams) SendEvent(ctx context.Context, event event.Event, eventSources []string) error
- func (b *Teams) SendGenericMessage(ctx context.Context, genericMsg interactive.GenericMessage, ...) error
- func (b *Teams) SendMessageToAll(ctx context.Context, msg interactive.Message) error
- func (b *Teams) SetNotificationsEnabled(enabled bool, ref schema.ConversationReference) error
- func (b *Teams) Start(ctx context.Context) error
- func (b *Teams) Type() config.IntegrationType
Constants ¶
const ( // WebSocketProtocol stores protocol initials for web socket WebSocketProtocol = "ws://" // WebSocketSecureProtocol stores protocol initials for web socket WebSocketSecureProtocol = "wss://" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalyticsReporter ¶ added in v0.13.0
type AnalyticsReporter interface { // ReportBotEnabled reports an enabled bot. ReportBotEnabled(platform config.CommPlatformIntegration) error }
AnalyticsReporter defines a reporter that collects analytics data.
type Bot ¶
Bot connects to communication channels and reads/sends messages. It is a two-way integration.
type Discord ¶ added in v0.13.0
type Discord struct {
// contains filtered or unexported fields
}
Discord listens for user's message, execute commands and sends back the response.
func NewDiscord ¶ added in v0.13.0
func NewDiscord(log logrus.FieldLogger, commGroupName string, cfg config.Discord, executorFactory ExecutorFactory, reporter AnalyticsReporter) (*Discord, error)
NewDiscord creates a new Discord instance.
func (*Discord) IntegrationName ¶ added in v0.13.0
func (b *Discord) IntegrationName() config.CommPlatformIntegration
IntegrationName describes the integration name.
func (*Discord) NotificationsEnabled ¶ added in v0.13.0
NotificationsEnabled returns current notification status for a given channel ID.
func (*Discord) SendEvent ¶ added in v0.13.0
func (b *Discord) SendEvent(_ context.Context, event event.Event, eventSources []string) (err error)
SendEvent sends event notification to Discord ChannelID. Context is not supported by client: See https://github.com/bwmarrin/discordgo/issues/752.
func (*Discord) SendGenericMessage ¶ added in v0.16.0
func (b *Discord) SendGenericMessage(_ context.Context, genericMsg interactive.GenericMessage, sourceBindings []string) error
SendGenericMessage sends interactive message to selected Discord channels. Context is not supported by client: See https://github.com/bwmarrin/discordgo/issues/752.
func (*Discord) SendMessageToAll ¶ added in v0.16.0
SendMessageToAll sends interactive message to all Discord channels. Context is not supported by client: See https://github.com/bwmarrin/discordgo/issues/752.
func (*Discord) SetNotificationsEnabled ¶ added in v0.13.0
SetNotificationsEnabled sets a new notification status for a given channel ID.
func (*Discord) Start ¶ added in v0.13.0
Start starts the Discord websocket connection and listens for messages.
func (*Discord) Type ¶ added in v0.13.0
func (b *Discord) Type() config.IntegrationType
Type describes the integration type.
type EventCommandProvider ¶ added in v0.15.0
type EventCommandProvider interface {
GetCommandsForEvent(event event.Event, executorBindings []string) ([]kubectl.Command, error)
}
EventCommandProvider describes a provider for event commands.
type ExecutorFactory ¶ added in v0.13.0
type ExecutorFactory interface {
NewDefault(cfg execute.NewDefaultInput) execute.Executor
}
ExecutorFactory facilitates creation of execute.Executor instances.
type FatalErrorAnalyticsReporter ¶ added in v0.13.0
type FatalErrorAnalyticsReporter interface { AnalyticsReporter // ReportFatalError reports a fatal app error. ReportFatalError(err error) error // Close cleans up the reporter resources. Close() error }
FatalErrorAnalyticsReporter reports a fatal errors.
type Mattermost ¶ added in v0.13.0
type Mattermost struct {
// contains filtered or unexported fields
}
Mattermost listens for user's message, execute commands and sends back the response.
func NewMattermost ¶ added in v0.13.0
func NewMattermost(log logrus.FieldLogger, commGroupName string, cfg config.Mattermost, executorFactory ExecutorFactory, reporter AnalyticsReporter) (*Mattermost, error)
NewMattermost creates a new Mattermost instance.
func (*Mattermost) BotName ¶ added in v0.14.0
func (b *Mattermost) BotName() string
BotName returns the Bot name.
func (*Mattermost) IntegrationName ¶ added in v0.13.0
func (b *Mattermost) IntegrationName() config.CommPlatformIntegration
IntegrationName describes the notifier integration name.
func (*Mattermost) NotificationsEnabled ¶ added in v0.13.0
func (b *Mattermost) NotificationsEnabled(channelID string) bool
NotificationsEnabled returns current notification status for a given channel ID.
func (*Mattermost) SendGenericMessage ¶ added in v0.16.0
func (b *Mattermost) SendGenericMessage(_ context.Context, genericMsg interactive.GenericMessage, sourceBindings []string) error
SendGenericMessage sends message to selected Mattermost channels.
func (*Mattermost) SendMessageToAll ¶ added in v0.16.0
func (b *Mattermost) SendMessageToAll(_ context.Context, msg interactive.Message) error
SendMessageToAll sends message to all Mattermost channels.
func (*Mattermost) SetNotificationsEnabled ¶ added in v0.13.0
func (b *Mattermost) SetNotificationsEnabled(channelID string, enabled bool) error
SetNotificationsEnabled sets a new notification status for a given channel ID.
func (*Mattermost) Start ¶ added in v0.13.0
func (b *Mattermost) Start(ctx context.Context) error
Start establishes mattermost connection and listens for messages
func (*Mattermost) Type ¶ added in v0.13.0
func (b *Mattermost) Type() config.IntegrationType
Type describes the notifier type.
type Slack ¶ added in v0.13.0
type Slack struct {
// contains filtered or unexported fields
}
Slack listens for user's message, execute commands and sends back the response.
func NewSlack ¶ added in v0.13.0
func NewSlack(log logrus.FieldLogger, commGroupName string, cfg config.Slack, executorFactory ExecutorFactory, reporter FatalErrorAnalyticsReporter) (*Slack, error)
NewSlack creates a new Slack instance.
func (*Slack) IntegrationName ¶ added in v0.13.0
func (b *Slack) IntegrationName() config.CommPlatformIntegration
IntegrationName describes the notifier integration name.
func (*Slack) NotificationsEnabled ¶ added in v0.13.0
NotificationsEnabled returns current notification status for a given channel name.
func (*Slack) SendGenericMessage ¶ added in v0.16.0
func (b *Slack) SendGenericMessage(_ context.Context, genericMsg interactive.GenericMessage, sourceBindings []string) error
SendGenericMessage sends message to selected Slack channels.
func (*Slack) SendMessageToAll ¶ added in v0.16.0
SendMessageToAll sends message to all Slack channels.
func (*Slack) SetNotificationsEnabled ¶ added in v0.13.0
SetNotificationsEnabled sets a new notification status for a given channel name.
func (*Slack) Start ¶ added in v0.13.0
Start starts the Slack RTM connection and listens for messages
func (*Slack) Type ¶ added in v0.13.0
func (b *Slack) Type() config.IntegrationType
Type describes the notifier type.
type SlackRenderer ¶ added in v0.14.0
type SlackRenderer struct {
// contains filtered or unexported fields
}
SlackRenderer provides functionality to render Slack specific messages from a generic models.
func NewSlackRenderer ¶ added in v0.14.0
func NewSlackRenderer(notificationType config.Notification) *SlackRenderer
NewSlackRenderer returns new SlackRenderer instance.
func (*SlackRenderer) RenderAsSlackBlocks ¶ added in v0.14.0
func (b *SlackRenderer) RenderAsSlackBlocks(msg interactive.Message) []slack.Block
RenderAsSlackBlocks returns the Slack message blocks for a given input message.
func (*SlackRenderer) RenderEventMessage ¶ added in v0.14.0
func (b *SlackRenderer) RenderEventMessage(event event.Event, additionalSections ...interactive.Section) interactive.Message
RenderEventMessage returns Slack interactive message based on a given event.
func (*SlackRenderer) RenderInteractiveMessage ¶ added in v0.14.0
func (b *SlackRenderer) RenderInteractiveMessage(msg interactive.Message) slack.MsgOption
RenderInteractiveMessage returns Slack message based on the input msg.
func (*SlackRenderer) RenderLegacyEventMessage ¶ added in v0.15.0
func (b *SlackRenderer) RenderLegacyEventMessage(event event.Event) slack.Attachment
RenderLegacyEventMessage returns Slack message based on a given event.
func (*SlackRenderer) RenderModal ¶ added in v0.14.0
func (b *SlackRenderer) RenderModal(msg interactive.Message) slack.ModalViewRequest
RenderModal returns a modal request view based on a given message.
type SocketSlack ¶ added in v0.14.0
type SocketSlack struct {
// contains filtered or unexported fields
}
SocketSlack listens for user's message, execute commands and sends back the response.
func NewSocketSlack ¶ added in v0.14.0
func NewSocketSlack(log logrus.FieldLogger, commGroupName string, cfg config.SocketSlack, executorFactory ExecutorFactory, eventCmdProvider EventCommandProvider, reporter socketSlackAnalyticsReporter) (*SocketSlack, error)
NewSocketSlack creates a new SocketSlack instance.
func (*SocketSlack) BotName ¶ added in v0.14.0
func (b *SocketSlack) BotName() string
BotName returns the Bot name.
func (*SocketSlack) IntegrationName ¶ added in v0.14.0
func (b *SocketSlack) IntegrationName() config.CommPlatformIntegration
IntegrationName describes the notifier integration name.
func (*SocketSlack) NotificationsEnabled ¶ added in v0.14.0
func (b *SocketSlack) NotificationsEnabled(channelName string) bool
NotificationsEnabled returns current notification status for a given channel name.
func (*SocketSlack) SendEvent ¶ added in v0.14.0
func (b *SocketSlack) SendEvent(ctx context.Context, event event.Event, eventSources []string) error
SendEvent sends event notification to slack
func (*SocketSlack) SendGenericMessage ¶ added in v0.16.0
func (b *SocketSlack) SendGenericMessage(_ context.Context, genericMsg interactive.GenericMessage, sourceBindings []string) error
SendGenericMessage sends message with interactive sections to selectred Slack channels.
func (*SocketSlack) SendMessageToAll ¶ added in v0.16.0
func (b *SocketSlack) SendMessageToAll(ctx context.Context, msg interactive.Message) error
SendMessageToAll sends message with interactive sections to all Slack channels.
func (*SocketSlack) SetNotificationsEnabled ¶ added in v0.14.0
func (b *SocketSlack) SetNotificationsEnabled(channelName string, enabled bool) error
SetNotificationsEnabled sets a new notification status for a given channel name.
func (*SocketSlack) Start ¶ added in v0.14.0
func (b *SocketSlack) Start(ctx context.Context) error
Start starts the Slack WebSocket connection and listens for messages
func (*SocketSlack) Type ¶ added in v0.14.0
func (b *SocketSlack) Type() config.IntegrationType
Type describes the notifier type.
type Teams ¶ added in v0.13.0
type Teams struct { AppID string AppPassword string MessagePath string Port string ClusterName string Notification config.Notification Adapter core.Adapter // contains filtered or unexported fields }
Teams listens for user's message, execute commands and sends back the response.
func NewTeams ¶ added in v0.13.0
func NewTeams(log logrus.FieldLogger, commGroupName string, cfg config.Teams, clusterName string, executorFactory ExecutorFactory, reporter AnalyticsReporter) (*Teams, error)
NewTeams creates a new Teams instance.
func (*Teams) IntegrationName ¶ added in v0.13.0
func (b *Teams) IntegrationName() config.CommPlatformIntegration
IntegrationName describes the integration name.
func (*Teams) NotificationsEnabled ¶ added in v0.13.0
NotificationsEnabled returns current notification status for a given channel ID.
func (*Teams) SendGenericMessage ¶ added in v0.16.0
func (b *Teams) SendGenericMessage(ctx context.Context, genericMsg interactive.GenericMessage, sourceBindings []string) error
SendGenericMessage sends message to MS Teams to selected conversations.
func (*Teams) SendMessageToAll ¶ added in v0.16.0
SendMessageToAll sends message to MS Teams to all conversations.
func (*Teams) SetNotificationsEnabled ¶ added in v0.13.0
func (b *Teams) SetNotificationsEnabled(enabled bool, ref schema.ConversationReference) error
SetNotificationsEnabled sets a new notification status for a given channel ID.
func (*Teams) Type ¶ added in v0.13.0
func (b *Teams) Type() config.IntegrationType
Type describes the integration type.