slackservice

package
v0.0.0-...-5230034 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SlackSigningSecret      string `split_words:"true" required:"true"`
	SlackVerificationToken  string `split_words:"true" required:"true"`
	SlackOauthAccessToken   string `split_words:"true" required:"true"`
	SlackMaintenanceEnabled bool   `split_words:"true" default:"false"`
}

Config needed for slack

EVEBOT_SLACK_SIGNING_SECRET
EVEBOT_SLACK_VERIFICATION_TOKEN
EVEBOT_SLACK_OAUTH_ACCESS_TOKEN
EVEBOT_SLACK_CHANNELS_MAINTENANCE
EVEBOT_SLACK_MAINTENANCE_ENABLED

type Provider

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

Provider is the Slack provider which wraps the slack the client

func New

func New(c *slack.Client, monitoringChannel string) Provider

New returns a new Slack provider

func (Provider) DeploymentNotificationThread

func (sp Provider) DeploymentNotificationThread(ctx context.Context, msg, user, channel, ts string)

DeploymentNotificationThread notifies the thread of the deployment results

func (Provider) ErrorNotification

func (sp Provider) ErrorNotification(ctx context.Context, user, channel string, err error)

ErrorNotification is a general error notification

func (Provider) ErrorNotificationThread

func (sp Provider) ErrorNotificationThread(ctx context.Context, user, channel, ts string, err error)

ErrorNotificationThread is a threaded error notification

func (Provider) GetChannelInfo

func (sp Provider) GetChannelInfo(ctx context.Context, channelID string) (chatmodels.Channel, error)

GetChannelInfo returns the slack channel info

func (Provider) GetUser

func (sp Provider) GetUser(ctx context.Context, user string) (*chatmodels.ChatUser, error)

GetUser returns user info

func (Provider) PostLinkMessageThread

func (sp Provider) PostLinkMessageThread(ctx context.Context, url string, user string, channel string, ts string)

PostLinkMessageThread sends a threaded message with links

func (Provider) PostMessage

func (sp Provider) PostMessage(ctx context.Context, msg, channel string) (timestamp string)

PostMessage sends a chat message

func (Provider) PostMessageThread

func (sp Provider) PostMessageThread(ctx context.Context, msg, channel, ts string) (timestamp string)

PostMessageThread sends a threaded message

func (Provider) PostPrivateMessage

func (sp Provider) PostPrivateMessage(ctx context.Context, msg string, user string)

func (Provider) ReleaseResultsMessageThread

func (sp Provider) ReleaseResultsMessageThread(ctx context.Context, msg, user, channel, ts string)

ReleaseResultsMessageThread sens the release results as a threaded message

func (Provider) ShowResultsMessageThread

func (sp Provider) ShowResultsMessageThread(ctx context.Context, msg, user, channel, ts string)

ShowResultsMessageThread sends a threaded results message

func (Provider) UserNotificationThread

func (sp Provider) UserNotificationThread(ctx context.Context, msg, user, channel, ts string)

UserNotificationThread notifies the user in a threaded message

Jump to

Keyboard shortcuts

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