-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,85 @@ | ||
[![CI](https://github.com/r-goswami/email-validator/actions/workflows/CI.yaml/badge.svg)](https://github.com/r-goswami/email-validator/actions/workflows/CI.yaml) | ||
[![codecov](https://codecov.io/gh/r-goswami/email-validator/branch/main/graph/badge.svg?token=VAB3KVPV1P)](https://codecov.io/gh/r-goswami/email-validator) | ||
[![Go Report Card](https://goreportcard.com/badge/github.com/r-goswami/email-validator)](https://goreportcard.com/report/github.com/r-goswami/email-validator) | ||
[![Go Reference](https://pkg.go.dev/badge/github.com/r-goswami/email-validator.svg)](https://pkg.go.dev/github.com/r-goswami/email-validator) | ||
|
||
# email-validator | ||
Go library to verify email addresses through Email verification API provided by 3rd party services as abstractApi, hunter.io etc. | ||
Go library to verify email addresses through Email verification API provided by 3rd party services - abstractapi.com and hunter.io. | ||
|
||
# Trying out clients | ||
## Features | ||
|
||
- Completely native (no 3rd party module dependencies) | ||
- Client side rate limiting | ||
- Ability to change rate limits | ||
|
||
# How to use http clients | ||
|
||
## abstract.com client | ||
```go | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"os" | ||
|
||
emailvalidator "github.com/r-goswami/email-validator" | ||
) | ||
|
||
func main() { | ||
apiKey := os.GetEnv("API_KEY") | ||
validator, err := emailvalidator.NewAbstractAPIClient(apiKey) | ||
if err != nil { | ||
log.Panic(err) | ||
} | ||
|
||
email := "[email protected]" | ||
resp, err := validator.Validate(email) | ||
if err != nil { | ||
fmt.Println(err) | ||
return | ||
} | ||
|
||
if resp.IsValid() { | ||
fmt.Printf("\n%s is a valid email\n", email) | ||
} | ||
} | ||
|
||
``` | ||
|
||
## hunter.io client | ||
```go | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"os" | ||
|
||
emailvalidator "github.com/r-goswami/email-validator" | ||
) | ||
|
||
func main() { | ||
apiKey := os.GetEnv("API_KEY") | ||
validator, err := emailvalidator.NewHunterAPIClient(apiKey) | ||
if err != nil { | ||
log.Panic(err) | ||
} | ||
|
||
email := "[email protected]" | ||
resp, err := validator.Validate(email) | ||
if err != nil { | ||
fmt.Println(err) | ||
return | ||
} | ||
|
||
if resp.IsValid() { | ||
fmt.Printf("\n%s is a valid email\n", email) | ||
} | ||
} | ||
|
||
``` | ||
|
||
|
||
# How to check clients using commands | ||
|
||
## abstract.com client | ||
### Build | ||
|