Documentation
¶
Index ¶
- Variables
- type Domain
- type Hit
- type HitList
- func (hl *HitList) Add(parts types.EmailParts, vr validator.Result) error
- func (hl *HitList) AddDomain(d string, vr validator.Result) error
- func (hl *HitList) AddEmailAddress(email string, vr validator.Result) error
- func (hl *HitList) AddEmailAddressDeadline(email string, vr validator.Result, duration time.Duration) error
- func (hl *HitList) AddInternalParts(domain Domain, recipient Recipient, vr validator.Result, ...) error
- func (hl *HitList) CreateInternalTypes(p types.EmailParts) (domain Domain, recipient Recipient, err error)
- func (hl *HitList) GetDomainValidationResult(d Domain) (validator.Result, bool)
- func (hl *HitList) GetRecipientCount(d Domain) (amount uint64)
- func (hl *HitList) GetValidAndUsageSortedDomains() []string
- func (hl *HitList) Has(parts types.EmailParts) (domain, local bool)
- type Hits
- type Recipient
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidDomainSyntax = errors.New("invalid domain syntax") ErrInvalidSyntax = errors.New("invalid syntax") )
Functions ¶
This section is empty.
Types ¶
type HitList ¶
type HitList struct {
// contains filtered or unexported fields
}
func (*HitList) AddEmailAddress ¶
AddEmailAddress records validations for a particular e-mail address.
func (*HitList) AddEmailAddressDeadline ¶
func (hl *HitList) AddEmailAddressDeadline(email string, vr validator.Result, duration time.Duration) error
AddEmailAddressDeadline Same as AddEmailAddress, but allows for custom TTL. Duration shouldn't be negative.
func (*HitList) AddInternalParts ¶
func (hl *HitList) AddInternalParts(domain Domain, recipient Recipient, vr validator.Result, duration time.Duration) error
AddInternalParts adds values considered "safe". Typically you would only use this on provisioning HitList from a storage layer
func (*HitList) CreateInternalTypes ¶
func (hl *HitList) CreateInternalTypes(p types.EmailParts) (domain Domain, recipient Recipient, err error)
CreateInternalTypes returns the Recipient and Domain types for an Email Type Parts. It's stateless, and solely works on the input. The input is not allowed to have empty parts. Typical use-case is when wanting to persist the "safe" value, to later re-add to a HitList
func (*HitList) GetDomainValidationResult ¶
func (*HitList) GetRecipientCount ¶
GetRecipientCount returns the amount of recipients known for a domain
func (*HitList) GetValidAndUsageSortedDomains ¶
GetValidAndUsageSortedDomains returns the used domains, sorted by their associated recipients (high>low)