Documentation ¶
Index ¶
- type Flag
- type Steps
- type Validations
- func (v Validations) HasFlag(f Flag) bool
- func (v Validations) IsValid() bool
- func (v Validations) IsValidationsForValidDomain() bool
- func (v *Validations) MarkAsInvalid()
- func (v *Validations) MarkAsValid()
- func (v Validations) MergeWithNext(new Validations) Validations
- func (v *Validations) RemoveFlag(f Flag) Validations
- func (v *Validations) SetFlag(new Flag) Validations
- func (v Validations) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Flag ¶
type Flag uint8
const ( FValid Flag = 1 << iota FSyntax Flag = 1 << iota FMXLookup Flag = 1 << iota FMXDomainHasIP Flag = 1 << iota // Flag set when the MX domain is verified to have at least one resolvable IP FHostConnect Flag = 1 << iota FValidRCPT Flag = 1 << iota FDisposable Flag = 1 << iota // Address / Domain is considered a disposable e-mail trap // FDomainHasIP is Deprecated: Unclear naming. Prefer FMXDomainHasIP FDomainHasIP = FMXDomainHasIP // @deprecated )
Validation Flags, these flags represent successful validation steps. Depending on how far you want to go, you can classify a validation as valid enough, for your use-case.
func (Flag) AsStringSlice ¶ added in v0.0.9
type Steps ¶
type Steps uint8
Steps holds the validation steps performed, they do not signify validity
func (Steps) HasBeenValidated ¶
HasBeenValidated returns true if any validations steps have actually been taken.
func (Steps) MergeWithNext ¶
MergeWithNext appends to Steps and returns the result.
func (*Steps) RemoveFlag ¶
type Validations ¶
type Validations uint8
Validations holds the validation steps performed.
func (Validations) HasFlag ¶
func (v Validations) HasFlag(f Flag) bool
HasFlag returns true if the type has the flag (or flags) specified
func (Validations) IsValid ¶
func (v Validations) IsValid() bool
IsValid returns true if the Validations are considered successful
func (Validations) IsValidationsForValidDomain ¶
func (v Validations) IsValidationsForValidDomain() bool
IsValidationsForValidDomain checks if a mask of validations really marks a domain as valid.
func (*Validations) MarkAsInvalid ¶
func (v *Validations) MarkAsInvalid()
MarkAsInvalid clears the CFValid bit and marks the Validations as invalid
func (*Validations) MarkAsValid ¶
func (v *Validations) MarkAsValid()
MarkAsValid sets the CFValid bit and marks the Validations as valid
func (Validations) MergeWithNext ¶
func (v Validations) MergeWithNext(new Validations) Validations
MergeWithNext appends to Validations are returns the result. If the new validations aren't considered valid, it will mark the new Validations as unsuccessful as well. It's opinionated in that it's part of an incremental validation chain
func (*Validations) RemoveFlag ¶
func (v *Validations) RemoveFlag(f Flag) Validations
RemoveFlag removes a flag and returns a copy
func (*Validations) SetFlag ¶
func (v *Validations) SetFlag(new Flag) Validations
SetFlag defines a flag on the type and returns a copy
func (Validations) String ¶
func (v Validations) String() string