GetPaths returns all paths tracked for a chat, deduplicated and sorted lexicographically.
(chatID uuid.UUID)
| 88 | // GetPaths returns all paths tracked for a chat, deduplicated |
| 89 | // and sorted lexicographically. |
| 90 | func (ps *PathStore) GetPaths(chatID uuid.UUID) []string { |
| 91 | ps.mu.RLock() |
| 92 | defer ps.mu.RUnlock() |
| 93 | |
| 94 | m := ps.chatPaths[chatID] |
| 95 | if len(m) == 0 { |
| 96 | return nil |
| 97 | } |
| 98 | out := make([]string, 0, len(m)) |
| 99 | for p := range m { |
| 100 | out = append(out, p) |
| 101 | } |
| 102 | slices.Sort(out) |
| 103 | return out |
| 104 | } |
| 105 | |
| 106 | // Len returns the number of chat IDs that have tracked paths. |
| 107 | func (ps *PathStore) Len() int { |
no outgoing calls