Documentation
¶
Overview ¶
Package bots generates and validates the email-shaped addresses used as the public identity of service accounts (e.g. n8n-prod@brave.otter.bot).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidDomain = errors.New("invalid_domain")
ErrInvalidDomain is returned when the domain fails validation or doesn't end in .bot.
var ErrInvalidLabel = errors.New("invalid_label")
ErrInvalidLabel is returned when the local part fails validation.
Functions ¶
func Compose ¶
Compose joins label and domain into a full bot address. Caller must have validated both halves first.
func GenerateDomain ¶
func GenerateDomain() string
GenerateDomain returns a randomly chosen `<adjective>.<noun>.bot` string. Uses crypto/rand for each word so callers can retry on collision.
func GenerateDomainExtended ¶
func GenerateDomainExtended() string
GenerateDomainExtended returns a 3-word fallback `<adjective>.<noun>.<adjective>.bot` for the (extremely rare) case where retries with two words all collide.
func IsBotAddress ¶
IsBotAddress reports whether s is a syntactically valid bot address.
func Split ¶
Split breaks an address into (label, domain). The boolean is false if there's no exactly-one '@' or either side is empty.
func ValidateDomain ¶
ValidateDomain checks the part after the @. Must end in .bot, max 63 chars, labels separated by dots, lowercase alphanumeric plus hyphens.
func ValidateLabel ¶
ValidateLabel checks the part before the @. Letters, numbers, hyphens; 1-31 chars.
Types ¶
This section is empty.