Documentation ¶
Overview ¶
Package identity contains helper functions for Mute identities.
Index ¶
- Constants
- Variables
- func IsMapped(identity string) error
- func Map(identity string) (string, error)
- func MapDomain(domain string) string
- func MapLocalpart(localpart string) (string, error)
- func MapPlus(identity string) (mappedID, mappedDomain string, err error)
- func Split(identity string) (localpart, domain string, err error)
Constants ¶
View Source
const Alphabet = "abcdefghijklmnopqrstuvwxyz0123456789-."
Alphabet defines the alphabet for the localpart of Mute identities.
View Source
const MaxLen = 254
MaxLen defines the maximum length of a Mute identity (localpart@domain). The restriction is the same as with email addresses.
Variables ¶
View Source
var ErrNotMapped = errors.New("identity: identity is not well-formed or not mapped")
ErrNotMapped is returned if an identity is not well-formed or not mapped.
View Source
var ErrTooLong = fmt.Errorf("identity: maximum total length is %d", MaxLen)
ErrTooLong is returned if an identity is too long (larger than MaxLen).
Functions ¶
func Map ¶
Map maps the given identity to the allowed character set and reports unrecoverable errors.
func MapLocalpart ¶
MapLocalpart maps the given localpart to the allowed character set and reports unrecoverable errors.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.