Documentation
¶
Index ¶
- Constants
- type AnalyticsReporter
- type Bot
- type Discord
- func (b *Discord) IntegrationName() config.CommPlatformIntegration
- func (b *Discord) NotificationsEnabled(channelID string) bool
- func (b *Discord) SendEvent(_ context.Context, event events.Event, eventSources []string) (err error)
- func (b *Discord) SendMessage(_ context.Context, msg string) 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 ExecutorFactory
- type FatalErrorAnalyticsReporter
- type Mattermost
- func (b *Mattermost) IntegrationName() config.CommPlatformIntegration
- func (b *Mattermost) NotificationsEnabled(channelID string) bool
- func (b *Mattermost) SendEvent(_ context.Context, event events.Event, eventSources []string) error
- func (b *Mattermost) SendMessage(_ context.Context, msg string) 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) IntegrationName() config.CommPlatformIntegration
- func (b *Slack) NotificationsEnabled(channelName string) bool
- func (b *Slack) SendEvent(ctx context.Context, event events.Event, eventSources []string) error
- func (b *Slack) SendMessage(ctx context.Context, msg string) 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 Teams
- func (b *Teams) IntegrationName() config.CommPlatformIntegration
- func (b *Teams) NotificationsEnabled(channelID string) bool
- func (b *Teams) SendEvent(ctx context.Context, event events.Event, eventSources []string) error
- func (b *Teams) SendMessage(ctx context.Context, msg string) 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 ¶
type Bot interface {
Start(ctx context.Context) error
IntegrationName() config.CommPlatformIntegration
controller.Notifier
}
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, 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 events.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) SendMessage ¶ added in v0.13.0
SendMessage sends message to Discord channel. 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 ExecutorFactory ¶ added in v0.13.0
type ExecutorFactory interface {
NewDefault(platform config.CommPlatformIntegration, notifierHandler execute.NotifierHandler, isAuthChannel bool, conversationID string, bindings []string, message string) 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, cfg config.Mattermost, executorFactory ExecutorFactory, reporter AnalyticsReporter) (*Mattermost, error)
NewMattermost creates a new Mattermost instance.
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) SendMessage ¶ added in v0.13.0
func (b *Mattermost) SendMessage(_ context.Context, msg string) error
SendMessage sends message to Mattermost channel
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, 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) SendMessage ¶ added in v0.13.0
SendMessage sends message to slack channel
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 Teams ¶ added in v0.13.0
type Teams struct {
BotName string
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, 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) SendMessage ¶ added in v0.13.0
SendMessage sends message to MsTeams
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.