Documentation ¶
Index ¶
- Variables
- type Domain
- type Hit
- type HitList
- func (hl *HitList) Add(parts types.EmailParts, vr validator.Result) error
- func (hl *HitList) AddDeadline(parts types.EmailParts, vr validator.Result, duration time.Duration) error
- func (hl *HitList) AddDomain(d string, vr validator.Result) error
- func (hl *HitList) AddEmailAddress(email string, vr validator.Result) error
- func (hl *HitList) AddInternalParts(domain Domain, recipient Recipient, vr validator.Result) error
- func (hl *HitList) AddInternalPartsDuration(domain Domain, recipient Recipient, vr validator.Result, ...) error
- func (hl *HitList) CreateInternalTypes(p types.EmailParts) (domain Domain, recipient Recipient, err error)
- func (hl *HitList) GetDomainValidationDetails(d Domain) (validator.Details, 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) AddDeadline ¶ added in v0.0.9
func (hl *HitList) AddDeadline(parts types.EmailParts, vr validator.Result, duration time.Duration) error
AddDeadline is similar to Add, but allows for custom TTL. Duration shouldn't be negative.
func (*HitList) AddEmailAddress ¶
AddEmailAddress records validations for a particular e-mail address.
func (*HitList) AddInternalParts ¶
AddInternalParts adds values considered "safe". Typically you would only use this on provisioning HitList from a storage layer
func (*HitList) AddInternalPartsDuration ¶ added in v0.0.9
func (hl *HitList) AddInternalPartsDuration(domain Domain, recipient Recipient, vr validator.Result, duration time.Duration) error
AddInternalPartsDuration adds values considered "safe". Has an extra duration option which shouldn't be negative
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) GetDomainValidationDetails ¶ added in v0.0.9
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)