notify

package module
v0.0.0-...-3a69f29 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: MIT Imports: 13 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(builder component.Builder)

Setup configures package services

Types

type Service

type Service interface {
	// Send a notification via Slack
	NotifySlack(msg *SlackMessage) error

	// Send a notification via Telegram
	NotifyTelegram(msg *TelegramMessage) error

	// Send a notification via webhook
	NotifyWebhook(msg *WebhookMessage) error
}

Service provides methods to send notifications

func GetService

func GetService(c di.Container) Service

GetService returns an implementation Service from DI container

type SlackMessage

type SlackMessage struct {
	To    []string
	Title string
	Text  string
	Emoji string
}

SlackMessage is a content for Slack notification

type TelegramMessage

type TelegramMessage struct {
	To    []string
	Title string
	Text  string
	Emoji string
}

TelegramMessage is a content for Telegram notification

type WebhookMessage

type WebhookMessage struct {
	To          []string
	PayloadJSON interface{}
}

WebhookMessage is a content for webhook notification

Jump to

Keyboard shortcuts

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