Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type List ¶
type List struct { Timestamp time.Time `json:"timestamp"` Expires time.Time `json:"expires"` Version string `json:"version"` Author string `json:"author"` PolicyAliases map[string]TLSPolicy `json:"policy-aliases"` Policies map[string]TLSPolicy `json:"policies"` }
List is a raw representation of the policy list.
type TLSPolicy ¶
type TLSPolicy struct { PolicyAlias string `json:"policy-alias,omitempty"` Mode string `json:"mode,omitempty"` MXs []string `json:"mxs,omitempty"` }
TLSPolicy dictates the policy for a particular email domain.
type UpdatedList ¶
type UpdatedList struct { *List // contains filtered or unexported fields }
UpdatedList wraps a list that is updated from a remote policyURL every hour. Safe for concurrent calls to `Get`.
func MakeUpdatedList ¶
func MakeUpdatedList() *UpdatedList
MakeUpdatedList wraps makeUpdatedList to use FetchListHTTP by default to update policy list
func (*UpdatedList) DomainsToValidate ¶
func (l *UpdatedList) DomainsToValidate() ([]string, error)
DomainsToValidate [interface Validator] retrieves domains from the DB whose policies should be validated.
func (*UpdatedList) Get ¶
func (l *UpdatedList) Get(domain string) (TLSPolicy, error)
Get safely reads from the underlying policy list and returns a TLSPolicy for a domain
func (*UpdatedList) HasDomain ¶
func (l *UpdatedList) HasDomain(domain string) bool
HasDomain returns true if a domain is present on the policy list.
func (*UpdatedList) HostnamesForDomain ¶
func (l *UpdatedList) HostnamesForDomain(domain string) ([]string, error)
HostnamesForDomain [interface Validator] retrieves the hostname policy for a particular domain.
func (*UpdatedList) Raw ¶
func (l *UpdatedList) Raw() List
Raw returns a raw List struct, copied from the underlying one