mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-24 22:39:09 +02:00
Fix moc interface
This commit is contained in:
@@ -16,6 +16,7 @@ type MockClient struct {
|
|||||||
SendToStreamFunc func(msg *proto.EncryptedMessage) error
|
SendToStreamFunc func(msg *proto.EncryptedMessage) error
|
||||||
SendFunc func(msg *proto.Message) error
|
SendFunc func(msg *proto.Message) error
|
||||||
SetOnReconnectedListenerFunc func(f func())
|
SetOnReconnectedListenerFunc func(f func())
|
||||||
|
SendWithDeliveryCheckFn func(msg *proto.Message) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetOnReconnectedListener sets the function to be called when the client reconnects.
|
// SetOnReconnectedListener sets the function to be called when the client reconnects.
|
||||||
@@ -82,3 +83,10 @@ func (sm *MockClient) Send(msg *proto.Message) error {
|
|||||||
}
|
}
|
||||||
return sm.SendFunc(msg)
|
return sm.SendFunc(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (sm *MockClient) SendWithDeliveryCheck(msg *proto.Message) error {
|
||||||
|
if sm.SendWithDeliveryCheckFn == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return sm.SendWithDeliveryCheck(msg)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user