Documentation ¶
Index ¶
- type EmailClientConfigData
- type EmailMethodInterface
- type EmailRepository
- type MailClient
- func (client *MailClient) SendEmail(senderEmail, recipientEmail, subject, body string) error
- func (client *MailClient) SendEmailBackupSuccess(timeStamp time.Time, bucketName, folderPathBackup, databaseName string) error
- func (client *MailClient) SendEmailFailedBackup(timeStamp time.Time, errorMessage error, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmailClientConfigData ¶
type EmailClientConfigData struct { Host string SmtpUsername string SmtpPassword string SmtpPort int }
func EmailProductionConfig ¶
func EmailProductionConfig() (emailClientConfig *EmailClientConfigData, err error)
Retrieve configuration data (eg. email provider, smtp port) from .env file for production settings only Base parameter for dependency injection of email client (production)
type EmailMethodInterface ¶
type EmailMethodInterface struct {
MethodInterface EmailRepository
}
func GetEmailMethods ¶
func GetEmailMethods(emailClientConfig *EmailClientConfigData) (emailClientMethods *EmailMethodInterface, err error)
func NewEmailMetodInterface ¶
func NewEmailMetodInterface(emailClient *MailClient) *EmailMethodInterface
type EmailRepository ¶
type EmailRepository interface { SendEmailBackupSuccess(timeStamp time.Time, bucketName, folderPathBackup, databaseName string) error SendEmailFailedBackup(timeStamp time.Time, errorMessage error, bucketName, folderPathBackup, databaseName string) error SendEmail(senderEmail, recipientEmail, subject, body string) error }
/////////////////////////////////////////////////////////////////////// Setup interface for email repository utilizing Dependency Injection /////////////////////
type MailClient ¶
type MailClient struct {
MyEmailClient *gomail.Dialer
}
func NewEmailClient ¶
func NewEmailClient(emailClientConfig *EmailClientConfigData) (client *MailClient, err error)
func (*MailClient) SendEmail ¶
func (client *MailClient) SendEmail(senderEmail, recipientEmail, subject, body string) error
func (*MailClient) SendEmailBackupSuccess ¶
func (client *MailClient) SendEmailBackupSuccess(timeStamp time.Time, bucketName, folderPathBackup, databaseName string) error
func (*MailClient) SendEmailFailedBackup ¶
Click to show internal directories.
Click to hide internal directories.