Skip to content

Commit

Permalink
🐛 move Email interface
Browse files Browse the repository at this point in the history
  • Loading branch information
perebaj committed Jan 22, 2024
1 parent 2496362 commit cab6f8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 4 additions & 0 deletions mail.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions scrape.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -173,4 +169,3 @@ func Fetch(url string) (string, error) {

return bodyString, nil
}

0 comments on commit cab6f8c

Please sign in to comment.