mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-16 07:16:38 +00:00
Support new Management service protocol (NetworkMap) (#193)
* feature: support new management service protocol * chore: add more logging to track networkmap serial * refactor: organize peer update code in engine * chore: fix lint issues * refactor: extract Signal client interface * test: add signal client mock * refactor: introduce Management Service client interface * chore: place management and signal clients mocks to respective packages * test: add Serial test to the engine * fix: lint issues * test: unit tests for a networkMapUpdate * test: unit tests Sync update
This commit is contained in:
16
util/common.go
Normal file
16
util/common.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package util
|
||||
|
||||
// SliceDiff returns the elements in slice `x` that are not in slice `y`
|
||||
func SliceDiff(x, y []string) []string {
|
||||
mapY := make(map[string]struct{}, len(y))
|
||||
for _, val := range y {
|
||||
mapY[val] = struct{}{}
|
||||
}
|
||||
var diff []string
|
||||
for _, val := range x {
|
||||
if _, found := mapY[val]; !found {
|
||||
diff = append(diff, val)
|
||||
}
|
||||
}
|
||||
return diff
|
||||
}
|
||||
Reference in New Issue
Block a user