Skip to content

Commit

Permalink
fix: README updated (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
r-goswami authored Jun 3, 2023
1 parent d21a517 commit fff3ec4
Showing 1 changed file with 76 additions and 2 deletions.
78 changes: 76 additions & 2 deletions README.md
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
Expand Down

0 comments on commit fff3ec4

Please sign in to comment.