bots

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 6 Imported by: 0

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

View Source
var ErrInvalidDomain = errors.New("invalid_domain")

ErrInvalidDomain is returned when the domain fails validation or doesn't end in .bot.

View Source
var ErrInvalidLabel = errors.New("invalid_label")

ErrInvalidLabel is returned when the local part fails validation.

Functions

func Compose

func Compose(label, domain string) string

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

func IsBotAddress(s string) bool

IsBotAddress reports whether s is a syntactically valid bot address.

func Split

func Split(s string) (label, domain string, ok bool)

Split breaks an address into (label, domain). The boolean is false if there's no exactly-one '@' or either side is empty.

func ValidateDomain

func ValidateDomain(domain string) error

ValidateDomain checks the part after the @. Must end in .bot, max 63 chars, labels separated by dots, lowercase alphanumeric plus hyphens.

func ValidateLabel

func ValidateLabel(label string) error

ValidateLabel checks the part before the @. Letters, numbers, hyphens; 1-31 chars.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL