chat

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Send(*CrashNotification)
}

Client informs a communication channel about a crash.

func NewClientFromEnv

func NewClientFromEnv() (Client, error)

NewClientFromEnv instantiates a new chat client using env configuration.

type ClientConfig

type ClientConfig struct {
	Type string `default:"mattermost"`
}

type CrashNotification

type CrashNotification struct {
	Title   string
	Message string
	Reason  string
	Logs    string
}

CrashNotification contains all data to print out a informative crash note.

type MattermostClient

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

func NewMattermostClientFromEnv

func NewMattermostClientFromEnv() (*MattermostClient, error)

NewMattermostClientFromEnv instantiates and configures a Mattermost client.

func (*MattermostClient) Send

func (client *MattermostClient) Send(note *CrashNotification)

Send constructs a new mattermost message containing information about the crash.

type MattermostConfig

type MattermostConfig struct {
	Token         string
	URL           string
	Team, Channel string
}

type SlackClient

type SlackClient struct {
	Client  *slack.Client
	Channel string
}

func NewSlackClientFromEnv

func NewSlackClientFromEnv() (*SlackClient, error)

NewSlackClientFromEnv instantiates and configures a Slack client.

func (*SlackClient) Send

func (client *SlackClient) Send(note *CrashNotification)

type SlackConfig

type SlackConfig struct {
	Token   string
	Channel string
}

type TelegramClient added in v0.3.0

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

func NewTelegramClientFromEnv added in v0.3.0

func NewTelegramClientFromEnv() (*TelegramClient, error)

NewTelegramClientFromEnv instantiates and configures a Telegram client.

func (*TelegramClient) Send added in v0.3.0

func (client *TelegramClient) Send(note *CrashNotification)

type TelegramConfig added in v0.3.0

type TelegramConfig struct {
	Token  string
	ChatID int64
}

Jump to

Keyboard shortcuts

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