mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-12 18:00:49 +01:00
e2f27502e4
Support search domain on Android - pass list of search domains to Android SDK - throw notification in case of search domain changes
46 lines
1.3 KiB
Go
46 lines
1.3 KiB
Go
package routemanager
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/netbirdio/netbird/client/internal/listener"
|
|
"github.com/netbirdio/netbird/iface"
|
|
"github.com/netbirdio/netbird/route"
|
|
)
|
|
|
|
// MockManager is the mock instance of a route manager
|
|
type MockManager struct {
|
|
UpdateRoutesFunc func(updateSerial uint64, newRoutes []*route.Route) error
|
|
StopFunc func()
|
|
}
|
|
|
|
// InitialRouteRange mock implementation of InitialRouteRange from Manager interface
|
|
func (m *MockManager) InitialRouteRange() []string {
|
|
return nil
|
|
}
|
|
|
|
// UpdateRoutes mock implementation of UpdateRoutes from Manager interface
|
|
func (m *MockManager) UpdateRoutes(updateSerial uint64, newRoutes []*route.Route) error {
|
|
if m.UpdateRoutesFunc != nil {
|
|
return m.UpdateRoutesFunc(updateSerial, newRoutes)
|
|
}
|
|
return fmt.Errorf("method UpdateRoutes is not implemented")
|
|
}
|
|
|
|
// Start mock implementation of Start from Manager interface
|
|
func (m *MockManager) Start(ctx context.Context, iface *iface.WGIface) {
|
|
}
|
|
|
|
// SetRouteChangeListener mock implementation of SetRouteChangeListener from Manager interface
|
|
func (m *MockManager) SetRouteChangeListener(listener listener.NetworkChangeListener) {
|
|
|
|
}
|
|
|
|
// Stop mock implementation of Stop from Manager interface
|
|
func (m *MockManager) Stop() {
|
|
if m.StopFunc != nil {
|
|
m.StopFunc()
|
|
}
|
|
}
|