Popularity
2.2
Growing
Activity
3.9
Growing
31
1
1

Programming language: Go
License: MIT License
Latest version: v1.1.6

go-email-normalizer alternatives and similar packages

Based on the "Authentication and OAuth" category.
Alternatively, view go-email-normalizer alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of go-email-normalizer or a related project?

Add another 'Authentication and OAuth' Package

README

go-email-normalizer - email normalization for Go

Build Status codecov Go Report Card License Mentioned in Awesome Go

This is Golang library for providing a canonical representation of email address. It allows to prevent multiple signups. go-email-normalizer contains some popular providers but you can easily append others.

Download

go get github.com/dimuska139/go-email-normalizer

Usage

package main

import (
    "fmt"
    "strings"
    normalizer "github.com/dimuska139/go-email-normalizer"
)

type customRule struct {}

func (rule *customRule) ProcessUsername(username string) string {
    return strings.Replace(username, "-", "", -1)
}

func (rule *customRule) ProcessDomain(domain string) string {
    return domain
}

func main() {
    n := normalizer.NewNormalizer()
    fmt.Println(n.Normalize("[email protected]")) // [email protected]
    fmt.Println(n.Normalize("[email protected]")) // [email protected]
    fmt.Println(n.Normalize("[email protected]")) // [email protected]
    fmt.Println(n.Normalize("[email protected]")) // [email protected]

    n.AddRule("customrules.com", &customRule{})
    fmt.Println(n.Normalize(" [email protected]")) // [email protected]
}

Supported providers

  • Apple
  • Fastmail
  • Google
  • Microsoft
  • Protonmail
  • Rackspace
  • Rambler
  • Yahoo
  • Yandex
  • Zoho

Also you can integrate another rules using AddRule function (see an example above)


*Note that all licence references and agreements mentioned in the go-email-normalizer README section above are relevant to that project's source code only.