emailparser

package
v0.3.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2024 License: AGPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidEmail = errors.New("invalid email address")
	ErrNoName       = errors.New("could not extract name from email")
)

Functions

This section is empty.

Types

type ParsedEmail

type ParsedEmail struct {
	Email     string
	FirstName string
	LastName  string
	Pattern   string
}

func Parse

func Parse(email string) (ParsedEmail, error)

type Pattern

type Pattern string
const (
	PatternDelimited      Pattern = "delimited"       // brugnone.fabio
	PatternFirstName      Pattern = "firstname"       // abigail
	PatternCombined       Pattern = "combined"        // adambangh, michaelstewart
	PatternFullName       Pattern = "fullname"        // joshua.j.kim, brownjasmine
	PatternNameInitial    Pattern = "name.initial"    // tyler.g, colinj
	PatternInitialSurname Pattern = "initial.surname" // pslack, nfalletti
	PatternSurnameInitial Pattern = "surname.initial" // chapmann.a
	PatternUnknown        Pattern = "unknown"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL