channels

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package channels provides different communication channels to notify users.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel interface {
	// SendMessage sends a message to users.
	SendMessage(ctx context.Context, message *Message) error
}

Channel defines the methods of a communication channel.

func NewMailChannel

func NewMailChannel(cfg config.Config, logger log.Logger) (Channel, error)

NewMailChannel instantiates a new mail communication channel.

type Mail

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

Mail is the communication channel for email.

func (Mail) SendMessage

func (m Mail) SendMessage(_ context.Context, message *Message) error

SendMessage sends a message to all given users.

type Message

type Message struct {
	Sender       string
	Recipient    []string
	Subject      string
	TextBody     string
	HTMLBody     string
	AttachInline map[string][]byte
}

Message represent the already rendered message including the user id opaqueID

Jump to

Keyboard shortcuts

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