[#607] network: Generalize LocalAddressSource to address group

Make `LocalAddressSource.LocalAddress` method to return `AddressGroup`. Make
`IsLocalAddress` function to accept parameter of type `AddressGroup`. Adopt
the application code with temporary `GroupFromAddress` helper.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-06-22 13:25:44 +03:00 committed by Leonard Lyubich
parent e11f50ec8e
commit 6e5d7f84af
7 changed files with 15 additions and 15 deletions

View file

@ -90,7 +90,7 @@ type cfg struct {
cfgNodeInfo cfgNodeInfo
localAddr network.Address
localAddr network.AddressGroup
cfgObject cfgObject
@ -285,7 +285,7 @@ func initCfg(path string) *cfg {
tlsCertFile: tlsCertFile,
tlsKeyFile: tlsKeyFile,
},
localAddr: netAddr,
localAddr: network.GroupFromAddress(netAddr),
respSvc: response.NewService(
response.WithNetworkState(state),
),
@ -308,7 +308,7 @@ func initCfg(path string) *cfg {
return c
}
func (c *cfg) LocalAddress() network.Address {
func (c *cfg) LocalAddress() network.AddressGroup {
return c.localAddr
}