From 6fdea28236771ee1d90a6fc959075c79939ad566 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 8 Dec 2024 13:57:25 +0800 Subject: CAP: Primitive negotiation --- cap.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 cap.go (limited to 'cap.go') diff --git a/cap.go b/cap.go new file mode 100644 index 0000000..83dfbda --- /dev/null +++ b/cap.go @@ -0,0 +1,25 @@ +package main + +import ( + "strings" +) + +var Caps = map[string]string{ + "sasl": "PLAIN,EXTERNAL", +} + +var capls string + +// Can't be in init() because Caps will be registered with init in the future +// and init()s are executed by filename alphabetical order +func setupCapls() { + capls = "" + for k, v := range Caps { + capls += k + if v != "" { + capls += "=" + v + } + capls += " " + } + capls = strings.TrimSuffix(capls, " ") +} -- cgit v1.2.3