puremail

package module
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLenMax             = errors.New("too many characters")
	ErrManyA              = errors.New("to many @")
	ErrInvalidLogin       = errors.New("invalid email login")
	ErrInvalidLoginChars  = errors.New("invalid email login characters")
	ErrInvalidDomain      = errors.New("invalid email domain")
	ErrInvalidDomainChars = errors.New("invalid email domain characters")
	ErrEndToTag           = errors.New("end to tag")
	ErrEndToEOF           = errors.New("end to EOF")
	ErrPanic              = errors.New("catch panic")

	ErrTooShort  = errors.New("payload is too short")
	ErrCRC       = errors.New("CRC‑32 mismatch")
	ErrMalformed = errors.New("malformed payload")

	ErrNilMX         = errors.New("no MX records found")
	ErrToManyLookups = errors.New("too many lookups")
)
View Source
var DefaultConfig = &ConfigObj{
	NoCache: true,
	MX: ConfigMxObj{
		TllPos:       6 * time.Hour,
		TllNeg:       15 * time.Minute,
		RefreshAhead: 10 * time.Minute,

		TimeoutDns:      400 * time.Millisecond,
		TimeoutDnsBurst: 2 * time.Second,
		TimeoutRefresh:  90 * time.Second,

		ShardAbs:     4,
		ShardMaxSize: 10_000,

		ConcurrencyLimitLookupMX: 250,
	},

	Ctx: context.Background(),
}

Functions

func Init added in v0.3.6

func Init(configuration *ConfigObj)

func InitDefault added in v0.3.6

func InitDefault()

Types

type ConfigMxObj added in v0.3.6

type ConfigMxObj struct {
	TllPos       time.Duration
	TllNeg       time.Duration
	RefreshAhead time.Duration

	TimeoutDns      time.Duration
	TimeoutDnsBurst time.Duration
	TimeoutRefresh  time.Duration

	ShardAbs     byte // must be 1..31
	ShardMaxSize uint32

	ConcurrencyLimitLookupMX uint32
}

type ConfigObj added in v0.3.6

type ConfigObj struct {
	NoCache bool
	MX      ConfigMxObj

	Ctx context.Context
}

type EmailObj

type EmailObj struct {
	// contains filtered or unexported fields
}

func Decode

func Decode(data []byte) (*EmailObj, error)

func New

func New(mail string) (*EmailObj, error)

func NewFast

func NewFast(mail string) (*EmailObj, error)

func (*EmailObj) Bytes

func (obj *EmailObj) Bytes() []byte

func (*EmailObj) Domain

func (obj *EmailObj) Domain() string

func (*EmailObj) HasMX

func (obj *EmailObj) HasMX() error

func (*EmailObj) Hash

func (obj *EmailObj) Hash() [hashBlockSize]byte

func (*EmailObj) HashFull

func (obj *EmailObj) HashFull() [hashBlockSize]byte

func (*EmailObj) Login

func (obj *EmailObj) Login() string

func (*EmailObj) Mail

func (obj *EmailObj) Mail() string

func (*EmailObj) MailFull

func (obj *EmailObj) MailFull() string

func (*EmailObj) Prefixes

func (obj *EmailObj) Prefixes() []EmailPrefixObj

func (*EmailObj) String

func (obj *EmailObj) String() string

type EmailPrefixObj

type EmailPrefixObj struct {
	// contains filtered or unexported fields
}

func (*EmailPrefixObj) Prefix

func (p *EmailPrefixObj) Prefix() byte

func (*EmailPrefixObj) String

func (p *EmailPrefixObj) String() string

Jump to

Keyboard shortcuts

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