Use bytes for flows event id (#3439)

This commit is contained in:
Viktor Liu
2025-03-07 16:12:47 +01:00
committed by GitHub
parent cb16d0f45f
commit 86370a0e7b
6 changed files with 23 additions and 20 deletions
+5 -3
View File
@@ -5,18 +5,20 @@ import (
"golang.org/x/exp/maps"
"github.com/google/uuid"
"github.com/netbirdio/netbird/client/internal/netflow/types"
)
func NewMemoryStore() *Memory {
return &Memory{
events: make(map[string]*types.Event),
events: make(map[uuid.UUID]*types.Event),
}
}
type Memory struct {
mux sync.Mutex
events map[string]*types.Event
events map[uuid.UUID]*types.Event
}
func (m *Memory) StoreEvent(event *types.Event) {
@@ -41,7 +43,7 @@ func (m *Memory) GetEvents() []*types.Event {
return events
}
func (m *Memory) DeleteEvents(ids []string) {
func (m *Memory) DeleteEvents(ids []uuid.UUID) {
m.mux.Lock()
defer m.mux.Unlock()
for _, id := range ids {