diff options
author | Valery Piashchynski <[email protected]> | 2021-06-02 17:25:09 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-06-02 17:25:09 +0300 |
commit | 12c031ce76c505128ebf9daafa91952855f202d4 (patch) | |
tree | 51846c0cd8a452246e383deb2ac00cce9ef1b92c /plugins/websockets/storage/storage.go | |
parent | 352b0f7cfcc1beaeb4d66777f30732f4003ce6d2 (diff) |
- Switch from the json to flatbuffers
Signed-off-by: Valery Piashchynski <[email protected]>
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() |