notification

package
v4.38.17 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOpportunisticSMTPAuth added in v4.38.0

func NewOpportunisticSMTPAuth(config *schema.NotifierSMTP) smtp.Auth

NewOpportunisticSMTPAuth is an opportunistic smtp.Auth implementation.

Types

type FileNotifier

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

FileNotifier a notifier to send emails to SMTP servers.

func NewFileNotifier

func NewFileNotifier(configuration schema.NotifierFileSystem) *FileNotifier

NewFileNotifier create an FileNotifier writing the notification into a file.

func (*FileNotifier) Send

func (n *FileNotifier) Send(_ context.Context, recipient mail.Address, subject string, et *templates.EmailTemplate, data any) (err error)

Send send a identity verification link to a user.

func (*FileNotifier) StartupCheck

func (n *FileNotifier) StartupCheck() (err error)

StartupCheck implements the startup check provider interface.

type Notifier

type Notifier interface {
	model.StartupCheck

	Send(ctx context.Context, recipient mail.Address, subject string, et *templates.EmailTemplate, data any) (err error)
}

Notifier interface for sending the identity verification link.

type OpportunisticSMTPAuth added in v4.38.0

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

OpportunisticSMTPAuth is an opportunistic smtp.Auth implementation.

func (*OpportunisticSMTPAuth) Next added in v4.38.0

func (a *OpportunisticSMTPAuth) Next(fromServer []byte, more bool) (toServer []byte, err error)

Next continues the authentication. The server has just sent the fromServer data. If more is true, the server expects a response, which Next should return as toServer; otherwise Next should return toServer == nil. If Next returns a non-nil error, the SMTP client aborts the authentication attempt and closes the connection.

func (*OpportunisticSMTPAuth) Start added in v4.38.0

func (a *OpportunisticSMTPAuth) Start(server *smtp.ServerInfo) (proto string, toServer []byte, err error)

Start begins an authentication with a server. It returns the name of the authentication protocol and optionally data to include in the initial AUTH message sent to the server. If it returns a non-nil error, the SMTP client aborts the authentication attempt and closes the connection.

type SMTPNotifier

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

SMTPNotifier a notifier to send emails to SMTP servers.

func NewSMTPNotifier

func NewSMTPNotifier(config *schema.NotifierSMTP, certPool *x509.CertPool) *SMTPNotifier

NewSMTPNotifier creates a SMTPNotifier using the notifier configuration.

func (*SMTPNotifier) Send

func (n *SMTPNotifier) Send(ctx context.Context, recipient mail.Address, subject string, et *templates.EmailTemplate, data any) (err error)

Send a notification via the SMTPNotifier.

func (*SMTPNotifier) StartupCheck

func (n *SMTPNotifier) StartupCheck() (err error)

StartupCheck implements model.StartupCheck to perform startup check operations.

Jump to

Keyboard shortcuts

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