Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove gmail api verifier #113

Merged
merged 27 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion smtp_by_api.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package emailverifier

const (
GMAIL = "gmail"
YAHOO = "yahoo"
)

Expand Down
53 changes: 0 additions & 53 deletions smtp_by_api_gmail.go

This file was deleted.

25 changes: 0 additions & 25 deletions smtp_by_api_gmail_test.go

This file was deleted.

20 changes: 0 additions & 20 deletions smtp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,6 @@ func TestCheckSMTPOK_ByApi(t *testing.T) {
username string
expected *SMTP
}{
{
name: "gmail exists",
domain: "gmail.com",
username: "someone",
expected: &SMTP{
HostExists: true,
Deliverable: true,
},
},
{
name: "gmail no exists",
domain: "gmail.com",
username: "hello",
expected: &SMTP{
HostExists: true,
Deliverable: false,
},
},
{
name: "yahoo exists",
domain: "yahoo.com",
Expand Down Expand Up @@ -75,9 +57,7 @@ func TestCheckSMTPOK_ByApi(t *testing.T) {
},
},
}
_ = verifier.EnableAPIVerifier(GMAIL)
_ = verifier.EnableAPIVerifier(YAHOO)
defer verifier.DisableAPIVerifier(GMAIL)
defer verifier.DisableAPIVerifier(YAHOO)
for _, c := range cases {
test := c
Expand Down
4 changes: 1 addition & 3 deletions verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Verifier struct {
helloName string // email to use in the `MAIL FROM:` SMTP command. defaults to `localhost`
schedule *schedule // schedule represents a job schedule
proxyURI string // use a SOCKS5 proxy to verify the email,
apiVerifiers map[string]smtpAPIVerifier // currently support gmail & yahoo, further contributions are welcomed.
apiVerifiers map[string]smtpAPIVerifier // currently support yahoo, further contributions are welcomed.
}

// Result is the result of Email Verification
Expand Down Expand Up @@ -139,8 +139,6 @@ func (v *Verifier) EnableSMTPCheck() *Verifier {
// If you use this feature in a production environment, please ensure that you have sufficient backup measures in place, as this may encounter rate limiting or other API issues.
func (v *Verifier) EnableAPIVerifier(name string) error {
switch name {
case GMAIL:
v.apiVerifiers[GMAIL] = newGmailAPIVerifier(http.DefaultClient)
case YAHOO:
v.apiVerifiers[YAHOO] = newYahooAPIVerifier(http.DefaultClient)
default:
Expand Down
Loading