groupware: add /bootstrap

* add a GET /accounts/{a}/boostrap URI that delivers the same as GET /
   but also mailboxes for a given account, in case the UI remembers the
   last used account identifier, to avoid an additional roundtrip

 * streamline the use of simpleError()

 * add logging of errors at the calling site

 * add logging of evictions of Sessions from the cache

 * change default Session cache TTL to 5min instead of 30sec
This commit is contained in:
Pascal Bleser
2025-08-21 15:27:45 +02:00
parent 7af4a01de6
commit 0e8bbe7038
17 changed files with 370 additions and 126 deletions

View File

@@ -2,6 +2,9 @@
package structs
import (
"maps"
"slices"
orderedmap "github.com/wk8/go-ordered-map"
)
@@ -30,3 +33,11 @@ func Uniq[T comparable](source []T) []T {
}
return set
}
func Keys[K comparable, V any](source map[K]V) []K {
if source == nil {
var zero []K
return zero
}
return slices.Collect(maps.Keys(source))
}