listener

package
v0.0.0-...-020d6ab Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mailer

type Mailer struct {
	Sender, Receiver string
	Dialer           *gomail.Dialer
	SubjectLine      func(webmention.Mention) string
	Body             func(webmention.Mention) string
}

Mailer is a webmention.Notifier that -- whenever a mention is received -- sends an email notification from Sender to Receiver, with a subject line produced by SubjectLine and the email body produced by Body.

func NewMailer

func NewMailer(dialer *gomail.Dialer, sender, receiver string) Mailer

Configure a mailer. The SubjectLine and Body properties of the Mailer may be modified to generate custom email subjects and contents, when notifying about Webmentions.

func (Mailer) Receive

func (m Mailer) Receive(mention webmention.Mention)

Receive implements webmention.Notifier

type MatrixBot

type MatrixBot struct {
	Client        *mautrix.Client
	ReportToRoom  id.RoomID
	FormatMessage func(webmention.Mention) string
}

func NewMatrixBot

func NewMatrixBot(client *mautrix.Client, reportToRoom id.RoomID) MatrixBot

func (MatrixBot) Receive

func (bot MatrixBot) Receive(mention webmention.Mention)

Jump to

Keyboard shortcuts

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