Versions in this module Expand all Collapse all v1 v1.13.0 Dec 24, 2023 v1.11.1 Dec 26, 2023 Changes in this version + const Enforce + const None + const Testing + var ErrInvalidMX = errors.New("invalid mx") + var ErrInvalidMaxAge = errors.New("invalid max_age") + var ErrInvalidMediaType = errors.New("invalid HTTP media type") + var ErrInvalidMode = errors.New("invalid mode") + var ErrUnknownVersion = errors.New("unknown policy version") + type Mode string + type Policy struct + MXs []string + MaxAge time.Duration + Mode Mode + Version string + func Fetch(ctx context.Context, domain string) (*Policy, error) + func UncheckedFetch(ctx context.Context, domain string) (*Policy, error) + func (p *Policy) Check() error + func (p *Policy) MXIsAllowed(mx string) bool + type PolicyCache struct + func NewCache(dir string) (*PolicyCache, error) + func (c *PolicyCache) Fetch(ctx context.Context, domain string) (*Policy, error) + func (c *PolicyCache) PeriodicallyRefresh(ctx context.Context)