diff --git a/v2/internal/utopia/client.go b/v2/internal/utopia/client.go index 39d03cf..3c88d62 100644 --- a/v2/internal/utopia/client.go +++ b/v2/internal/utopia/client.go @@ -426,13 +426,13 @@ func (c *UtopiaClient) ToogleChannelNotifications(channelID string, enabled bool } // GetNetworkConnections - get current network peers -func (c *UtopiaClient) GetNetworkConnections(channelID string) ([]PeerInfo, error) { +func (c *UtopiaClient) GetNetworkConnections(channelID string) ([]structs.PeerInfo, error) { response, err := c.apiQuery("getNetworkConnections", map[string]interface{}{}) if err != nil { return nil, err } - data := []PeerInfo{} + data := []structs.PeerInfo{} if err := convertResult(response, &data); err != nil { return nil, err } diff --git a/v2/internal/utopia/structs.go b/v2/internal/utopia/structs.go index a065eeb..965195a 100644 --- a/v2/internal/utopia/structs.go +++ b/v2/internal/utopia/structs.go @@ -30,8 +30,3 @@ type query struct { Params map[string]interface{} `json:"params"` Filters map[string]interface{} `json:"filter"` } - -type PeerInfo struct { - Direction int `json:"direction"` - Address string `json:"remoteAddress"` -} diff --git a/v2/messenger.go b/v2/messenger.go index 1587dbc..ecab041 100644 --- a/v2/messenger.go +++ b/v2/messenger.go @@ -120,6 +120,9 @@ type Client interface { // ToogleChannelNotifications - enable or disable channel notifications ToogleChannelNotifications(channelID string, enabled bool) error + + // GetNetworkConnections - get current network peers + GetNetworkConnections(channelID string) ([]structs.PeerInfo, error) } type Config = utopia.Config diff --git a/v2/pkg/structs/structs.go b/v2/pkg/structs/structs.go index 5a8c55c..b6d4391 100644 --- a/v2/pkg/structs/structs.go +++ b/v2/pkg/structs/structs.go @@ -109,3 +109,8 @@ type SearchChannelData struct { Name string `json:"name"` // Monica OwnerPubkey string `json:"owner"` // 1B742E8D8DAE682ADD2568BE25B23F35BA7A8BFC1D5D3BCA0EE219A754A48201 } + +type PeerInfo struct { + Direction int `json:"direction"` + Address string `json:"remoteAddress"` +}