notifier

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailMessage

type EmailMessage struct {
	From    string `json:"from"`
	To      string `json:"to"`
	Subject string `json:"subject"`
	Message string `json:"message"`
	ReplyTo string `json:"replyTo"`
}

EmailMessage email message object

type EmailNotifier

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

EmailNotifier email notifier using payfazz messenger as library

func NewEmailNotifier

func NewEmailNotifier(
	awsRegion string,
	awsAccessKeyID string,
	awsSecretAccessKey string,
	awsToken string,
) *EmailNotifier

NewEmailNotifier create new email notifier

func (*EmailNotifier) Notify

func (en *EmailNotifier) Notify(message string) error

Notify Notify function are not implemented on email

func (*EmailNotifier) Send

func (en *EmailNotifier) Send(ctx context.Context, data interface{}) error

Send sending email

type Notifier

type Notifier interface {
	Notify(message string) error
	Send(ctx context.Context, data interface{}) error
}

Notifier is the interface that wraps the Notify method.

Notify notifies the message to the output channel. The implementation channel can be slack/email/etc.

type SlackNotifier

type SlackNotifier struct {
	Token      string
	Channel    string
	HTTPClient *http.Client
}

SlackNotifier represents the notifier that will notify to slack channel

func NewSlackNotifier

func NewSlackNotifier(config SlackNotifierConfig) *SlackNotifier

NewSlackNotifier creates a new slack notifier

func (*SlackNotifier) Notify

func (sn *SlackNotifier) Notify(message string) error

Notify notifies message to a slack channel

func (*SlackNotifier) Send

func (sn *SlackNotifier) Send(ctx context.Context, data interface{}) error

Send send function are not implemented on this medium

type SlackNotifierConfig

type SlackNotifierConfig struct {
	Token      string
	Channel    string
	HTTPClient *http.Client
}

SlackNotifierConfig represent the config needed when creating a new slack notifier

type TelegramNotifier

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

TelegramNotifier telegram notifier

func NewTelegramNotifier

func NewTelegramNotifier(
	telegramClient client.GenericHTTPClient,
	channelID string,
	secretToken string,
) *TelegramNotifier

NewTelegramNotifier create new telegram notifier

func (*TelegramNotifier) Notify

func (tn *TelegramNotifier) Notify(message string) error

Notify send message to registered username

func (*TelegramNotifier) Send

func (tn *TelegramNotifier) Send(ctx context.Context, data interface{}) error

Send this method is not implemented yet

Jump to

Keyboard shortcuts

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