channels

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 12 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, userIDs []string, msg, subject, senderDisplayName string) error
	// SendMessageToGroup sends a message to a group.
	SendMessageToGroup(ctx context.Context, groupdID *groups.GroupId, msg, subject, senderDisplayName string) 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(ctx context.Context, userIDs []string, msg, subject, senderDisplayName string) error

SendMessage sends a message to all given users.

func (Mail) SendMessageToGroup

func (m Mail) SendMessageToGroup(ctx context.Context, groupID *groups.GroupId, msg, subject, senderDisplayName string) error

SendMessageToGroup sends a message to all members of the given group.

Jump to

Keyboard shortcuts

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