Add isQueueAddress() and parseQueueName() helpers to router.go (gt-0q3cg)

Add queue address detection following the same pattern as list address
detection. Includes tests in router_test.go.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gastown/polecats/dementus
2025-12-30 22:09:38 -08:00
committed by Steve Yegge
parent 52fe464d10
commit fb5870350c
2 changed files with 56 additions and 0 deletions
+10
View File
@@ -60,6 +60,16 @@ func parseListName(address string) string {
return strings.TrimPrefix(address, "list:")
}
// isQueueAddress returns true if the address uses queue:name syntax.
func isQueueAddress(address string) bool {
return strings.HasPrefix(address, "queue:")
}
// parseQueueName extracts the queue name from a queue:name address.
func parseQueueName(address string) string {
return strings.TrimPrefix(address, "queue:")
}
// expandList returns the recipients for a mailing list.
// Returns ErrUnknownList if the list is not found.
func (r *Router) expandList(listName string) ([]string, error) {