"go.mau.fi/whatsmeow/types"
)
+// Routes owns the root's source map. Writes replace the private file before
+// changing the map in memory. The mutex protects reads and writes from tools
+// and status commands. Logs omit source IDs, which can hold phone numbers.
+type Routes struct {
+ mutex sync.Mutex
+ path string
+ logger *slog.Logger
+ targets map[string]string
+}
+
// openRoutes reads the source-to-child map. A missing file has no routes.
func openRoutes(path string, logger *slog.Logger) (*Routes, error) {
r := &Routes{
return r, nil
}
-// Routes owns the root's source map. Writes replace the private file before
-// changing the map in memory. The mutex protects reads and writes from tools
-// and status commands. Logs omit source IDs, which can hold phone numbers.
-type Routes struct {
- mutex sync.Mutex
- path string
- logger *slog.Logger
- targets map[string]string
-}
-
// Set maps source to a child name, or removes it when target is empty. The
// caller checks that a nonempty target is a child of the root.
func (r *Routes) Set(source, target string) error {