diff options
Diffstat (limited to 'plugins/websockets/storage/storage.go')
-rw-r--r-- | plugins/websockets/storage/storage.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/websockets/storage/storage.go b/plugins/websockets/storage/storage.go index ac256be2..43834658 100644 --- a/plugins/websockets/storage/storage.go +++ b/plugins/websockets/storage/storage.go @@ -63,6 +63,17 @@ func (s *Storage) GetByPtrTS(topics []string, res map[string]struct{}) { } } } +func (s *Storage) GetOneByPtr(topic string, res map[string]struct{}) { + s.RLock() + defer s.RUnlock() + + d := s.BST.Get(topic) + if len(d) > 0 { + for ii := range d { + res[ii] = struct{}{} + } + } +} func (s *Storage) GetByPtr(topics []string, res map[string]struct{}) { s.RLock() |