From cf40ed6cecc003f72d57d832fe669bfb376f6b14 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Tue, 13 Aug 2019 09:33:33 +0200 Subject: [PATCH] lib/connections: Return exported intf from exported function (#5947) --- lib/api/mocked_connections_test.go | 4 ++++ lib/connections/service.go | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/api/mocked_connections_test.go b/lib/api/mocked_connections_test.go index 608a12640..11883b775 100644 --- a/lib/api/mocked_connections_test.go +++ b/lib/api/mocked_connections_test.go @@ -27,3 +27,7 @@ func (m *mockedConnections) NATType() string { func (m *mockedConnections) Serve() {} func (m *mockedConnections) Stop() {} + +func (m *mockedConnections) ExternalAddresses() []string { return nil } + +func (m *mockedConnections) AllAddresses() []string { return nil } diff --git a/lib/connections/service.go b/lib/connections/service.go index 167b7da01..aa54b4893 100644 --- a/lib/connections/service.go +++ b/lib/connections/service.go @@ -90,6 +90,7 @@ var tlsVersionNames = map[uint16]string{ // dialers. Successful connections are handed to the model. type Service interface { suture.Service + discover.AddressLister ListenerStatus() map[string]ListenerStatusEntry ConnectionStatus() map[string]ConnectionStatusEntry NATType() string @@ -129,9 +130,7 @@ type service struct { connectionStatus map[string]ConnectionStatusEntry // address -> latest error/status } -func NewService(cfg config.Wrapper, myID protocol.DeviceID, mdl Model, tlsCfg *tls.Config, discoverer discover.Finder, - bepProtocolName string, tlsDefaultCommonName string) *service { - +func NewService(cfg config.Wrapper, myID protocol.DeviceID, mdl Model, tlsCfg *tls.Config, discoverer discover.Finder, bepProtocolName string, tlsDefaultCommonName string) Service { service := &service{ Supervisor: suture.New("connections.Service", suture.Spec{ Log: func(line string) {