From cab6f8ce6654467e2028865635e60548536242b0 Mon Sep 17 00:00:00 2001 From: jojo Date: Mon, 22 Jan 2024 17:26:59 -0300 Subject: [PATCH] :bug: move Email interface --- mail.go | 4 ++++ scrape.go | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/mail.go b/mail.go index 63f5054..18b2c58 100644 --- a/mail.go +++ b/mail.go @@ -26,6 +26,10 @@ func NewMailClient(cfg EmailConfig) *MailClient { } } +type Email interface { + Send(dest []string, bodyMessage string) error +} + // Send sends an email to the given destination func (m MailClient) Send(dest []string, bodyMessage string) error { auth := smtp.PlainAuth("", m.cfg.UserName, m.cfg.Password, SMTPServer) diff --git a/scrape.go b/scrape.go index 43b2fd3..3209c40 100644 --- a/scrape.go +++ b/scrape.go @@ -32,10 +32,6 @@ type Storage interface { PageIn(ctx context.Context, urls []string) ([]mongodb.Page, error) } -type Email interface { - Send(dest []string, bodyMessage string) error -} - // Crawler contains the necessary information to run the crawler type Crawler struct { URLch chan string @@ -173,4 +169,3 @@ func Fetch(url string) (string, error) { return bodyString, nil } -